From a2376b9b53fe358f50e72138a48d38dc5b6bdf62 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 25 Aug 2023 21:15:00 +0200 Subject: [PATCH] refactor: workaround to enable clang-16 compilation --- src/core/include/mp-units/bits/quantity_concepts.h | 4 ++++ src/core/include/mp-units/bits/quantity_point_concepts.h | 4 ++++ src/core/include/mp-units/quantity.h | 8 ++++++++ src/core/include/mp-units/quantity_point.h | 8 ++++++++ 4 files changed, 24 insertions(+) diff --git a/src/core/include/mp-units/bits/quantity_concepts.h b/src/core/include/mp-units/bits/quantity_concepts.h index 559bfc11..42e5903a 100644 --- a/src/core/include/mp-units/bits/quantity_concepts.h +++ b/src/core/include/mp-units/bits/quantity_concepts.h @@ -32,8 +32,12 @@ namespace mp_units { template Rep> class quantity; +#if MP_UNITS_COMP_CLANG < 17 +template +#else template requires quantity>::_rep_safe_constructible_ +#endif [[nodiscard]] constexpr quantity> make_quantity(Rep&& v); namespace detail { diff --git a/src/core/include/mp-units/bits/quantity_point_concepts.h b/src/core/include/mp-units/bits/quantity_point_concepts.h index 5aa1257d..695d9da3 100644 --- a/src/core/include/mp-units/bits/quantity_point_concepts.h +++ b/src/core/include/mp-units/bits/quantity_point_concepts.h @@ -110,8 +110,12 @@ template auto PO, RepresentationOf Rep> class quantity_point; +#if MP_UNITS_COMP_CLANG < 17 +template +#else template requires ReferenceOf, PO.quantity_spec> +#endif [[nodiscard]] constexpr quantity_point make_quantity_point(Q&& q); namespace detail { diff --git a/src/core/include/mp-units/quantity.h b/src/core/include/mp-units/quantity.h index 0512f733..6cd9a78e 100644 --- a/src/core/include/mp-units/quantity.h +++ b/src/core/include/mp-units/quantity.h @@ -325,8 +325,12 @@ public: } private: +#if MP_UNITS_COMP_CLANG < 17 + template +#else template requires quantity>::_rep_safe_constructible_ +#endif friend constexpr quantity> make_quantity(Rep2&&); template @@ -435,8 +439,12 @@ template } // make_quantity +#if MP_UNITS_COMP_CLANG < 17 +template +#else template requires quantity>::_rep_safe_constructible_ +#endif [[nodiscard]] constexpr quantity> make_quantity(Rep&& v) { return quantity>(std::forward(v)); diff --git a/src/core/include/mp-units/quantity_point.h b/src/core/include/mp-units/quantity_point.h index 23dfaebc..6deea3e0 100644 --- a/src/core/include/mp-units/quantity_point.h +++ b/src/core/include/mp-units/quantity_point.h @@ -207,8 +207,12 @@ public: } private: +#if MP_UNITS_COMP_CLANG < 17 + template +#else template requires ReferenceOf, PO2.quantity_spec> +#endif friend constexpr quantity_point make_quantity_point(Q&&); template @@ -356,8 +360,12 @@ template QP2> } // make_quantity_point +#if MP_UNITS_COMP_CLANG < 17 +template +#else template requires ReferenceOf, PO.quantity_spec> +#endif [[nodiscard]] constexpr quantity_point make_quantity_point(Q&& q) { return quantity_point(std::forward(q));