Commit fa3bac5d authored by Dominik Charousset's avatar Dominik Charousset

Add static getter to atom constants

parent af46f59c
......@@ -65,13 +65,22 @@ struct atom_constant {
constexpr atom_constant() {
// nop
}
/// Returns the wrapped value.
constexpr operator atom_value() const {
return V;
}
/// Returns the wrapped value as its base type.
static constexpr uint64_t uint_value() {
return static_cast<uint64_t>(V);
}
/// Returns the wrapped value.
static constexpr atom_value get_value() {
return V;
}
/// Returns an instance *of this constant* (*not* an `atom_value`).
static const atom_constant value;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment