Template for encoding a semantic version as a ulong at compile-time.
The version is encoded as major * 100_000_000 + minor * 10_000 + patch, enabling simple numeric comparisons in static if statements. Minor and patch each use 4 digits (0-9999); major has no fixed limit.
Note
This is NOT the same encoding as
ddn.ddn.ddnVersion()
(3 digits per component). Do not mix the two encodings in comparisons.
Parameters
major | Major version number (0 to practical ulong limits) |
minor | Minor version number (0-9999) |
patch | Patch version number (0-9999, defaults to 0) Example: enum VER_1_10 = SEMVER!(1, 10, 0);
static if (VER_1_10 <= SEMVER!(1, 12, 3)) {
// Code for version 1.12.3 or later
}
static assert(SEMVER!(1, 2, 3) == 1_0002_0003);
|