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 for

    compile-time version checks and conditional compilation.

  • Runtime string: ddnVersionString() - canonical string representation

    for display and logging purposes.

Important: When bumping versions, both the enums AND the version string in

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.

Numeric Encoding:

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

fnint ddnVersion() nothrow @nogc pureReturns the library version as a single integer for numeric comparisons.
fnstring ddnVersionString() nothrow @nogc pureReturns the library version as a canonical string.

Variables 3

enumvarMAJOR = 6

Major version number. Incremented for breaking API changes.

enumvarMINOR = 3

Minor version number. Incremented for new features (backward compatible).

enumvarPATCH = 2

Patch version number. Incremented for bug fixes.