diff --git a/src/core/include/mp-units/bits/unit_magnitude.h b/src/core/include/mp-units/bits/unit_magnitude.h index 94bbade3..d882adf9 100644 --- a/src/core/include/mp-units/bits/unit_magnitude.h +++ b/src/core/include/mp-units/bits/unit_magnitude.h @@ -52,7 +52,7 @@ import std; namespace mp_units::detail { template -concept MagArg = std::integral || MagConstant; +concept MagArg = std::integral || is_mag_constant; /** * @brief Any type which can be used as a basis vector in a power_v. @@ -89,7 +89,7 @@ template { if constexpr (is_specialization_of_v) return get_base_value(T::base); - else if constexpr (MagConstant) + else if constexpr (is_mag_constant) return element._value_; else return element; @@ -559,7 +559,7 @@ template template [[nodiscard]] consteval auto remove_mag_constants(unit_magnitude m) { - if constexpr (MagConstant) + if constexpr (is_mag_constant) return unit_magnitude<>{}; else return m; @@ -568,7 +568,7 @@ template template [[nodiscard]] consteval auto only_positive_mag_constants(unit_magnitude m) { - if constexpr (MagConstant && get_exponent(M) >= 0) + if constexpr (is_mag_constant && get_exponent(M) >= 0) return m; else return unit_magnitude<>{}; @@ -577,7 +577,7 @@ template template [[nodiscard]] consteval auto only_negative_mag_constants(unit_magnitude m) { - if constexpr (MagConstant && get_exponent(M) < 0) + if constexpr (is_mag_constant && get_exponent(M) < 0) return m; else return unit_magnitude<>{}; @@ -619,7 +619,7 @@ constexpr auto prime_factorization_v = prime_factorization::value; template [[nodiscard]] consteval UnitMagnitude auto make_magnitude() { - if constexpr (MagConstant) + if constexpr (is_mag_constant) return unit_magnitude{}; else return prime_factorization_v; diff --git a/src/core/include/mp-units/framework/unit_magnitude_concepts.h b/src/core/include/mp-units/framework/unit_magnitude_concepts.h index a7c76bed..0204f327 100644 --- a/src/core/include/mp-units/framework/unit_magnitude_concepts.h +++ b/src/core/include/mp-units/framework/unit_magnitude_concepts.h @@ -46,14 +46,14 @@ MP_UNITS_EXPORT template #endif struct mag_constant; -MP_UNITS_EXPORT template -concept MagConstant = detail::SymbolicConstant && is_derived_from_specialization_of_v; - namespace detail { template struct unit_magnitude; +template +constexpr bool is_mag_constant = detail::SymbolicConstant && is_derived_from_specialization_of_v; + } /**