mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 13:14:29 +02:00
refactor: workaround to enable clang-16 compilation
This commit is contained in:
@@ -32,8 +32,12 @@ namespace mp_units {
|
|||||||
template<Reference auto R, RepresentationOf<get_quantity_spec(R).character> Rep>
|
template<Reference auto R, RepresentationOf<get_quantity_spec(R).character> Rep>
|
||||||
class quantity;
|
class quantity;
|
||||||
|
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto R, typename Rep>
|
||||||
|
#else
|
||||||
template<Reference auto R, typename Rep>
|
template<Reference auto R, typename Rep>
|
||||||
requires quantity<R, std::remove_cvref_t<Rep>>::_rep_safe_constructible_
|
requires quantity<R, std::remove_cvref_t<Rep>>::_rep_safe_constructible_
|
||||||
|
#endif
|
||||||
[[nodiscard]] constexpr quantity<R, std::remove_cvref_t<Rep>> make_quantity(Rep&& v);
|
[[nodiscard]] constexpr quantity<R, std::remove_cvref_t<Rep>> make_quantity(Rep&& v);
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@@ -110,8 +110,12 @@ template<Reference auto R, PointOriginFor<get_quantity_spec(R)> auto PO,
|
|||||||
RepresentationOf<get_quantity_spec(R).character> Rep>
|
RepresentationOf<get_quantity_spec(R).character> Rep>
|
||||||
class quantity_point;
|
class quantity_point;
|
||||||
|
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto PO, typename Q>
|
||||||
|
#else
|
||||||
template<PointOrigin auto PO, Quantity Q>
|
template<PointOrigin auto PO, Quantity Q>
|
||||||
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO.quantity_spec>
|
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO.quantity_spec>
|
||||||
|
#endif
|
||||||
[[nodiscard]] constexpr quantity_point<Q::reference, PO, typename Q::rep> make_quantity_point(Q&& q);
|
[[nodiscard]] constexpr quantity_point<Q::reference, PO, typename Q::rep> make_quantity_point(Q&& q);
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@@ -325,8 +325,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto R2, typename Rep2>
|
||||||
|
#else
|
||||||
template<Reference auto R2, typename Rep2>
|
template<Reference auto R2, typename Rep2>
|
||||||
requires quantity<R2, std::remove_cvref_t<Rep2>>::_rep_safe_constructible_
|
requires quantity<R2, std::remove_cvref_t<Rep2>>::_rep_safe_constructible_
|
||||||
|
#endif
|
||||||
friend constexpr quantity<R2, std::remove_cvref_t<Rep2>> make_quantity(Rep2&&);
|
friend constexpr quantity<R2, std::remove_cvref_t<Rep2>> make_quantity(Rep2&&);
|
||||||
|
|
||||||
template<typename Value>
|
template<typename Value>
|
||||||
@@ -435,8 +439,12 @@ template<auto R1, typename Rep1, auto R2, typename Rep2>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make_quantity
|
// make_quantity
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto R, typename Rep>
|
||||||
|
#else
|
||||||
template<Reference auto R, typename Rep>
|
template<Reference auto R, typename Rep>
|
||||||
requires quantity<R, std::remove_cvref_t<Rep>>::_rep_safe_constructible_
|
requires quantity<R, std::remove_cvref_t<Rep>>::_rep_safe_constructible_
|
||||||
|
#endif
|
||||||
[[nodiscard]] constexpr quantity<R, std::remove_cvref_t<Rep>> make_quantity(Rep&& v)
|
[[nodiscard]] constexpr quantity<R, std::remove_cvref_t<Rep>> make_quantity(Rep&& v)
|
||||||
{
|
{
|
||||||
return quantity<R, std::remove_cvref_t<Rep>>(std::forward<Rep>(v));
|
return quantity<R, std::remove_cvref_t<Rep>>(std::forward<Rep>(v));
|
||||||
|
@@ -207,8 +207,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto PO2, typename Q>
|
||||||
|
#else
|
||||||
template<PointOrigin auto PO2, Quantity Q>
|
template<PointOrigin auto PO2, Quantity Q>
|
||||||
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO2.quantity_spec>
|
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO2.quantity_spec>
|
||||||
|
#endif
|
||||||
friend constexpr quantity_point<Q::reference, PO2, typename Q::rep> make_quantity_point(Q&&);
|
friend constexpr quantity_point<Q::reference, PO2, typename Q::rep> make_quantity_point(Q&&);
|
||||||
|
|
||||||
template<Quantity Q>
|
template<Quantity Q>
|
||||||
@@ -356,8 +360,12 @@ template<QuantityPoint QP1, QuantityPointOf<QP1::absolute_point_origin> QP2>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make_quantity_point
|
// make_quantity_point
|
||||||
|
#if MP_UNITS_COMP_CLANG < 17
|
||||||
|
template<auto PO, typename Q>
|
||||||
|
#else
|
||||||
template<PointOrigin auto PO, Quantity Q>
|
template<PointOrigin auto PO, Quantity Q>
|
||||||
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO.quantity_spec>
|
requires ReferenceOf<std::remove_const_t<decltype(Q::reference)>, PO.quantity_spec>
|
||||||
|
#endif
|
||||||
[[nodiscard]] constexpr quantity_point<Q::reference, PO, typename Q::rep> make_quantity_point(Q&& q)
|
[[nodiscard]] constexpr quantity_point<Q::reference, PO, typename Q::rep> make_quantity_point(Q&& q)
|
||||||
{
|
{
|
||||||
return quantity_point<Q::reference, PO, typename Q::rep>(std::forward<Q>(q));
|
return quantity_point<Q::reference, PO, typename Q::rep>(std::forward<Q>(q));
|
||||||
|
Reference in New Issue
Block a user