diff --git a/src/include/units/base_dimension.h b/src/include/units/base_dimension.h index 0f1e5309..34546104 100644 --- a/src/include/units/base_dimension.h +++ b/src/include/units/base_dimension.h @@ -48,6 +48,7 @@ namespace units { * @tparam U a base unit to be used for this base dimension */ template + requires U::is_named struct base_dimension { using base_type_workaround = base_dimension; // TODO Replace with is_derived_from_instantiation when fixed static constexpr auto name = Name; @@ -58,7 +59,8 @@ struct base_dimension { // TODO Remove the below when https://bugs.llvm.org/show_bug.cgi?id=32208 is fixed // clang-format off template -struct base_dimension_less : std::bool_constant {}; +struct base_dimension_less : std::bool_constant< + D1::name < D2::name || (D1::name == D2::name && D1::base_unit::symbol < D1::base_unit::symbol)> {}; // clang-format on } // namespace units diff --git a/src/include/units/concepts.h b/src/include/units/concepts.h index 3934a93c..efc1fb51 100644 --- a/src/include/units/concepts.h +++ b/src/include/units/concepts.h @@ -90,6 +90,7 @@ concept Unit = is_derived_from_instantiation; // BaseDimension template + requires U::is_named struct base_dimension; namespace detail {