diff --git a/src/core/include/mp-units/framework/expression_template.h b/src/core/include/mp-units/framework/expression_template.h index 45d3d4b6..5195000c 100644 --- a/src/core/include/mp-units/framework/expression_template.h +++ b/src/core/include/mp-units/framework/expression_template.h @@ -56,12 +56,6 @@ struct per {}; namespace detail { -template -constexpr bool is_specialization_of_per = false; - -template -constexpr bool is_specialization_of_per> = true; - template constexpr bool valid_ratio = true; @@ -312,7 +306,7 @@ template typename OneType, typename List> else { using last_element = type_list_back; - if constexpr (is_specialization_of_per) { + if constexpr (is_specialization_of) { if constexpr (size == 2 && OneType>::value) return expr_fractions_result, type_list_map>{}; else { diff --git a/src/core/include/mp-units/framework/quantity_spec_concepts.h b/src/core/include/mp-units/framework/quantity_spec_concepts.h index 545b1875..9712a434 100644 --- a/src/core/include/mp-units/framework/quantity_spec_concepts.h +++ b/src/core/include/mp-units/framework/quantity_spec_concepts.h @@ -53,13 +53,7 @@ struct kind_of_; namespace detail { template -constexpr bool is_specialization_of_kind_of = false; - -template -constexpr bool is_specialization_of_kind_of> = true; - -template -concept QuantityKindSpec = is_specialization_of_kind_of; +concept QuantityKindSpec = is_specialization_of; #if MP_UNITS_API_NO_CRTP template diff --git a/src/core/include/mp-units/framework/reference_concepts.h b/src/core/include/mp-units/framework/reference_concepts.h index ffed704b..abebe0c8 100644 --- a/src/core/include/mp-units/framework/reference_concepts.h +++ b/src/core/include/mp-units/framework/reference_concepts.h @@ -32,17 +32,6 @@ namespace mp_units { MP_UNITS_EXPORT template struct reference; -namespace detail { - -// do not refactor below to a variable template - GCC-11 does not like it -template -struct is_specialization_of_reference : std::false_type {}; - -template -struct is_specialization_of_reference> : std::true_type {}; - -} // namespace detail - MP_UNITS_EXPORT_BEGIN [[nodiscard]] consteval QuantitySpec auto get_quantity_spec(AssociatedUnit auto u); @@ -67,7 +56,7 @@ template * Satisfied by all specializations of @c reference. */ template -concept Reference = AssociatedUnit || detail::is_specialization_of_reference::value; +concept Reference = AssociatedUnit || is_specialization_of; /** * @brief A concept matching all references with provided quantity spec diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index ec47afc9..4446ec3b 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -533,12 +533,6 @@ template return canonical_unit{num.mag / den.mag, num.reference_unit / den.reference_unit}; } -template -constexpr bool is_specialization_of_derived_unit = false; - -template -constexpr bool is_specialization_of_derived_unit> = true; - } // namespace detail MP_UNITS_EXPORT_BEGIN @@ -564,7 +558,7 @@ template return u; else if constexpr (detail::is_specialization_of_scaled_unit) return scaled_unit(U::mag), decltype(pow(U::reference_unit))>{}; - else if constexpr (detail::is_specialization_of_derived_unit) + else if constexpr (is_specialization_of) return detail::expr_pow(u); else if constexpr (Den == 1) return derived_unit>{};