Celeritas 0.6.0-dev.115+3b60a5fd
|
Simple version comparison. More...
#include <Version.hh>
Public Types | |
Type aliases | |
using | size_type = unsigned int |
using | ArrayT = std::array< size_type, 3 > |
Public Member Functions | |
constexpr | Version (size_type major, size_type minor=0, size_type patch=0) |
Construct from x.y.z integers. | |
Accessors | |
constexpr ArrayT const & | value () const |
Get version as an array. | |
constexpr size_type | major () const |
Get major version. | |
constexpr size_type | minor () const |
Get minor version. | |
constexpr size_type | patch () const |
Get patch version. | |
Static Public Member Functions | |
static Version | from_string (std::string_view sv) |
Construct from a string "1.2.3". | |
static constexpr Version | from_hex_xxyyzz (size_type value) |
Construct from an 0xXXYYZZ integer. | |
static constexpr Version | from_dec_xyz (size_type value) |
Construct from a decimal with XYZ or XXYZ. | |
Simple version comparison.
This is intended to be constructed with version numbers from celeritas_cmake_strings.hh
and used in unit tests. It can be used in if constexpr
expressions with preprocessor macros. In the constructor documentation, x/y/z correspond to major/minor/patch.
Construct from a decimal with XYZ or XXYZ.
This version scheme is used by Geant4.
Construct from an 0xXXYYZZ integer.
This version scheme is used by Celeritas. (The leading 0x prevents version 01
from turning the expression into an octal.)