File indexing completed on 2026-11-30 09:46:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #pragma once
0016
0017 #include <string_view>
0018
0019 #define ALGORITHMS_VERSION_MAJOR 2
0020 #define ALGORITHMS_VERSION_MINOR 2
0021 #define ALGORITHMS_VERSION_PATCH 0
0022 #define ALGORITHMS_VERSION_STRING "2.2.0"
0023
0024
0025
0026 #define ALGORITHMS_VERSION_CODE(major, minor, patch) \
0027 ((major) * 1000000 + (minor) * 1000 + (patch))
0028 #define ALGORITHMS_VERSION \
0029 ALGORITHMS_VERSION_CODE(ALGORITHMS_VERSION_MAJOR, ALGORITHMS_VERSION_MINOR, \
0030 ALGORITHMS_VERSION_PATCH)
0031
0032 namespace algorithms {
0033
0034 inline constexpr unsigned int versionMajor = ALGORITHMS_VERSION_MAJOR;
0035 inline constexpr unsigned int versionMinor = ALGORITHMS_VERSION_MINOR;
0036 inline constexpr unsigned int versionPatch = ALGORITHMS_VERSION_PATCH;
0037 inline constexpr std::string_view versionString = ALGORITHMS_VERSION_STRING;
0038
0039
0040 constexpr bool versionAtLeast(unsigned int major, unsigned int minor = 0, unsigned int patch = 0) {
0041 if (versionMajor != major) {
0042 return versionMajor > major;
0043 }
0044 if (versionMinor != minor) {
0045 return versionMinor > minor;
0046 }
0047 return versionPatch >= patch;
0048 }
0049
0050 }