diff --git a/src/include/units/base_dimension.h b/src/include/units/base_dimension.h index 57900028..750c9deb 100644 --- a/src/include/units/base_dimension.h +++ b/src/include/units/base_dimension.h @@ -50,7 +50,6 @@ namespace units { template requires U::is_named struct base_dimension { - using base_type_workaround = base_dimension; // TODO Replace with is_base_dimension when fixed static constexpr auto symbol = Symbol; ///< Unique base dimension identifier using base_unit = U; ///< Base unit adopted for this dimension }; diff --git a/src/include/units/concepts.h b/src/include/units/concepts.h index d21ef282..a14d361b 100644 --- a/src/include/units/concepts.h +++ b/src/include/units/concepts.h @@ -105,20 +105,14 @@ struct base_dimension; namespace detail { -#if __GNUC__ == 9 && __GNUC_MINOR__ < 2 +struct is_derived_from_base_dimension_impl { + template + static constexpr std::true_type check_base(const base_dimension&); + static constexpr std::false_type check_base(...); +}; template -inline constexpr bool is_base_dimension = true; - -#else - -template -inline constexpr bool is_base_dimension = false; - -template -inline constexpr bool is_base_dimension> = true; - -#endif +inline constexpr bool is_derived_from_base_dimension = decltype(is_derived_from_base_dimension_impl::check_base(std::declval()))::value; } // namespace detail @@ -128,7 +122,7 @@ inline constexpr bool is_base_dimension> = true; * Satisfied by all dimension types derived from the instantiation of `base_dimension`. */ template -concept BaseDimension = detail::is_base_dimension; +concept BaseDimension = detail::is_derived_from_base_dimension; // Exponent namespace detail { @@ -161,7 +155,7 @@ struct derived_dimension_base; * Satisfied by all dimension types derived from the instantiation of `detail::derived_dimension_base`. */ template -concept DerivedDimension = is_instantiation, detail::derived_dimension_base>; +concept DerivedDimension = is_derived_from_instantiation_of; // Dimension /**