Query version information¶
We define several constants that can be used for feature testing and reporting:
-
DUST_VERSION_MAJOR 0¶
-
DUST_VERSION_MINOR 15¶
-
DUST_VERSION_PATCH 1¶
-
DUST_VERSION_STRING "0.15.1"¶
The most useful for testing is DUST_VERSION_CODE
which is built from the major, minor and patch numbers (10000 * major + 100 + minor + patch), so version 1.23.45
would be 12345
and 0.4.8
would be 408
-
DUST_VERSION_CODE 1501¶
Example¶
#include <iostream>
#include <dust/random/random.hpp>
int main() {
// Check version compatibility at compile time or runtime
static_assert(DUST_VERSION_CODE > 1110, // requires at least 0.11.10
"Your version of dust is too old, please upgrade");
std::cout << DUST_VERSION_STRING << std::endl;
}
0.15.1