Skip to content

ddn.ddn

Module

module ddn.ddn;

Constants

  • enum MAJOR = 1;
    The major version of the DDN library.

  • enum MINOR = 0;
    The minor version of the DDN library.

  • enum PATCH = 0;
    The patch version of the DDN library.

These constants define the current version of the DDN library.


Functions

ddnVersion

static int ddnVersion() nothrow @nogc pure

Returns the version as a single integer, encoding the patch, minor, and major numbers.

  • Computation:
    PATCH + MINOR * 1_000 + MAJOR * 1_000_000

  • Example:

assert(ddnVersion() == 1_000_000); // For version 1.0.0

ddnVersionString

static string ddnVersionString() nothrow @nogc pure

Returns the version as a human-readable string, e.g., "1.0.0".

  • Example:
assert(ddnVersionString() == "1.0.0");

Examples

Displaying the DDN Version

import ddn.ddn;
import std.stdio;

void main() {
    writeln("DDN version (int): ", ddnVersion());
    writeln("DDN version (string): ", ddnVersionString());
}

Checking for a Minimum Version

import ddn.ddn;

void main() {
    enum REQUIRED = 1_000_000; // 1.0.0
    static if (ddnVersion() >= REQUIRED) {
        // Safe to use new features
    }
}

See Also


License

SPDX-License-Identifier: BSD-3-Clause