diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 3d2cfbf5..69668c74 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -44,12 +44,7 @@ namespace mp_units { namespace detail { template -concept WeaklyRegular = -#ifndef MP_UNITS_XCODE15_HACKS - true; -#else - std::copyable && std::equality_comparable; -#endif +concept WeaklyRegular = std::copyable && std::equality_comparable; template concept ScalableWith = requires(const T v, const S s) { @@ -175,13 +170,18 @@ template concept ComplexScalar = // TODO should the below be provided? // (!disable_complex) && - Addable && ScalableWith && requires(const T v, const T& ref) { + Addable && ScalableWith && + requires(const T v, const T& ref) { ::mp_units::real(v); ::mp_units::imag(v); ::mp_units::modulus(v); requires ScalableWith; requires std::constructible_from; - } && WeaklyRegular; + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; } // namespace detail @@ -197,8 +197,12 @@ MP_UNITS_INLINE constexpr bool disable_real = true; namespace detail { template -concept RealScalar = (!disable_real) && Addable && ScalableWith && std::totally_ordered && - (!ComplexScalar) && WeaklyRegular; +concept RealScalar = + (!disable_real) && Addable && ScalableWith && std::totally_ordered && (!ComplexScalar) +#if MP_UNITS_COMP_GCC != 12 && !defined(MP_UNITS_XCODE15_HACKS) + && WeaklyRegular +#endif + ; template concept Scalar = RealScalar || ComplexScalar; @@ -250,15 +254,20 @@ MP_UNITS_EXPORT inline constexpr ::mp_units::detail::magnitude_impl::magnitude_t namespace detail { template -concept Vector = Addable && requires(const T v) { - ::mp_units::magnitude(v); - requires ScalableWith; - // TODO should we also check for the below (e.g., when `size() > 1` or `2`) - // ::mp_units::zero_vector(); - // ::mp_units::scalar_product(a, b); - // ::mp_units::vector_product(a, b); - // ::mp_units::tensor_product(a, b); -} && WeaklyRegular; +concept Vector = Addable && + requires(const T v) { + ::mp_units::magnitude(v); + requires ScalableWith; + // TODO should we also check for the below (e.g., when `size() > 1` or `2`) + // ::mp_units::zero_vector(); + // ::mp_units::scalar_product(a, b); + // ::mp_units::vector_product(a, b); + // ::mp_units::tensor_product(a, b); + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; } // namespace detail