ddn.ddn
DDN Core Library Version Information
This module provides version constants and functions for the DDN library.
Version Management:The library version is defined in two forms:
- Compile-time enums:
MAJOR,MINOR,PATCH- integer components forcompile-time version checks and conditional compilation.
- Runtime string:
ddnVersionString()- canonical string representationfor display and logging purposes.
ddnVersionString() must be updated together. The string is intentionally separate (not computed from enums) to ensure it remains a compile-time constant suitable for embedding in binaries and to avoid any runtime string formatting overhead.
ddnVersion() encodes the version as a single integer using the formula: MAJOR * 1_000_000 + MINOR * 1_000 + PATCH, allowing numeric comparisons. Each component supports values 0-999.
Example:
// Check version at compile time
static if (MAJOR >= 5) {
// Use features from v5.x
}
// Check version at runtime
if (ddnVersion() >= 6_001_000) {
// v6.1.0 or later
}
// Display version
writeln("DDN version: ", ddnVersionString());Functions 2
int ddnVersion() nothrow @nogc pureReturns the library version as a single integer for numeric comparisons.Variables 3
MAJOR = 6Major version number. Incremented for breaking API changes.
MINOR = 3Minor version number. Incremented for new features (backward compatible).
PATCH = 2Patch version number. Incremented for bug fixes.