20concept UnitLike = std::is_base_of_v<UnitTag, U>;
29 return U::descriptor();
33template <MeasureLike M>
35 return M::descriptor();
39template <UnitLike A, UnitLike B>
41 return A::kind == B::kind;
45template <MeasureLike M, UnitLike U>
47 return std::is_same_v<typename M::base_unit_t, U>;
CRTP bases that turn unit/measure tag structs into self-describing types.
Concept satisfied by any struct that inherits from MeasureBase.
Definition traits.hpp:24
Concept satisfied by any struct that inherits from UnitBase.
Definition traits.hpp:20
Runtime metadata structs for units and measures.
Runtime metadata for a measure (a semantic specialization of a unit).
Definition descriptor.hpp:54
Runtime metadata for a unit.
Definition descriptor.hpp:29
constexpr bool measure_uses_unit() noexcept
True iff a measure's base unit is the given unit.
Definition traits.hpp:46
constexpr UnitDescriptor unit_descriptor_of() noexcept
Convenience accessor: descriptor of a unit struct.
Definition traits.hpp:28
constexpr MeasureDescriptor measure_descriptor_of() noexcept
Convenience accessor: descriptor of a measure struct.
Definition traits.hpp:34
constexpr bool units_compatible() noexcept
True iff two unit structs share the same kind (and therefore convert).
Definition traits.hpp:40