TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
#include <trlc/platform/compiler.hpp>
Static Public Member Functions | |
static | CompilerVersion (int maj, int min, int pat=0) |
Constructs a compiler version. More... | |
static | CompilerVersion () |
Default constructor for unknown version. More... | |
static bool | operator>= (const CompilerVersion &other) const |
static bool | operator< (const CompilerVersion &other) const |
Less than comparison. More... | |
static bool | operator== (const CompilerVersion &other) const |
Equality comparison. More... | |
static bool | operator!= (const CompilerVersion &other) const |
Inequality comparison. More... | |
static bool | operator> (const CompilerVersion &other) const |
Greater than comparison. More... | |
static bool | operator<= (const CompilerVersion &other) const |
Less than or equal comparison. More... | |
Public Attributes | |
int | major |
Major version number (e.g., 9 in GCC 9.3.0) More... | |
int | minor |
Minor version number (e.g., 3 in GCC 9.3.0) More... | |
int | patch |
Patch version number (e.g., 0 in GCC 9.3.0) More... | |
Definition at line 175 of file compiler.hpp.
|
inlinestatic |
Constructs a compiler version.
Creates a CompilerVersion with the specified version components. The patch version defaults to 0 if not specified, which is common for version checks that only care about major.minor versions.
maj | Major version number |
min | Minor version number |
pat | Patch version number (defaults to 0) |
Definition at line 194 of file compiler.hpp.
|
inlinestatic |
Default constructor for unknown version.
Creates a CompilerVersion with all components set to 0, indicating an unknown or undetectable compiler version.
Definition at line 206 of file compiler.hpp.
|
inlinestatic |
Inequality comparison.
Checks if two compiler versions are not equal in any component. This is the logical negation of operator==().
other | Version to compare against |
Definition at line 291 of file compiler.hpp.
|
inlinestatic |
Less than comparison.
Compares two compiler versions using lexicographic ordering. Useful for checking if a compiler version is below a certain threshold or for compatibility with older compiler versions.
other | Version to compare against |
Definition at line 252 of file compiler.hpp.
|
inlinestatic |
Less than or equal comparison.
other | Version to compare against |
Definition at line 309 of file compiler.hpp.
|
inlinestatic |
Equality comparison.
Checks if two compiler versions are exactly equal in all components (major, minor, patch). Useful for compiler-specific workarounds or exact version matching.
other | Version to compare against |
Definition at line 274 of file compiler.hpp.
|
inlinestatic |
Greater than comparison.
other | Version to compare against |
Definition at line 300 of file compiler.hpp.
|
inlinestatic |
Definition at line 230 of file compiler.hpp.
int trlc::platform::CompilerVersion::major |
Major version number (e.g., 9 in GCC 9.3.0)
Definition at line 176 of file compiler.hpp.
int trlc::platform::CompilerVersion::minor |
Minor version number (e.g., 3 in GCC 9.3.0)
Definition at line 177 of file compiler.hpp.
int trlc::platform::CompilerVersion::patch |
Patch version number (e.g., 0 in GCC 9.3.0)
Definition at line 178 of file compiler.hpp.