diff --git a/src/core/include/mp-units/bits/hacks.h b/src/core/include/mp-units/bits/hacks.h index 5030debb..905aea8f 100644 --- a/src/core/include/mp-units/bits/hacks.h +++ b/src/core/include/mp-units/bits/hacks.h @@ -80,10 +80,12 @@ #if MP_UNITS_COMP_MSVC #define MP_UNITS_TYPENAME typename +#define MP_UNITS_EXPRESSION(x) (x) #else #define MP_UNITS_TYPENAME +#define MP_UNITS_EXPRESSION(x) x #endif diff --git a/src/core/include/mp-units/framework/quantity_point.h b/src/core/include/mp-units/framework/quantity_point.h index 5b449ea8..58b28b3f 100644 --- a/src/core/include/mp-units/framework/quantity_point.h +++ b/src/core/include/mp-units/framework/quantity_point.h @@ -54,14 +54,14 @@ template struct point_origin_interface { template requires ReferenceOf, PO::quantity_spec> - [[nodiscard]] friend constexpr quantity_point operator+(PO, Q&& q) + [[nodiscard]] friend constexpr quantity_point operator+(PO, Q&& q) { return quantity_point{std::forward(q), PO{}}; } template requires ReferenceOf, PO::quantity_spec> - [[nodiscard]] friend constexpr quantity_point operator+(Q&& q, PO po) + [[nodiscard]] friend constexpr quantity_point operator+(Q&& q, PO po) { return po + std::forward(q); } @@ -191,13 +191,13 @@ public: [[nodiscard]] static constexpr quantity_point min() noexcept requires requires { quantity_type::min(); } { - return {quantity_type::min(), point_origin}; + return {quantity_type::min(), PO}; } [[nodiscard]] static constexpr quantity_point max() noexcept requires requires { quantity_type::max(); } { - return {quantity_type::max(), point_origin}; + return {quantity_type::max(), PO}; } // construction, assignment, destruction diff --git a/src/core/include/mp-units/framework/reference.h b/src/core/include/mp-units/framework/reference.h index 35f646ee..a0452b51 100644 --- a/src/core/include/mp-units/framework/reference.h +++ b/src/core/include/mp-units/framework/reference.h @@ -87,40 +87,40 @@ struct reference { } template - [[nodiscard]] friend consteval detail::reference_t<(Q{} * Q2{}), (U{} * U2{})> operator*(reference, reference) + [[nodiscard]] friend consteval detail::reference_t operator*(reference, reference) { return {}; } template - [[nodiscard]] friend consteval detail::reference_t<((Q{} * get_quantity_spec(U2{}))), (U{} * U2{})> operator*(reference, + [[nodiscard]] friend consteval detail::reference_t<(MP_UNITS_EXPRESSION(Q{} * get_quantity_spec(U2{}))), MP_UNITS_EXPRESSION(U{} * U2{})> operator*(reference, U2) { return {}; } template - [[nodiscard]] friend consteval detail::reference_t<(get_quantity_spec(U1{}) * Q{}), (U1{} * U{})> operator*(U1, + [[nodiscard]] friend consteval detail::reference_t operator*(U1, reference) { return {}; } template - [[nodiscard]] friend consteval detail::reference_t<(Q{} / Q2{}), (U{} / U2{})> operator/(reference, reference) + [[nodiscard]] friend consteval detail::reference_t operator/(reference, reference) { return {}; } template - [[nodiscard]] friend consteval detail::reference_t<(Q{} / get_quantity_spec(U2{})), (U{} / U2{})> operator/(reference, + [[nodiscard]] friend consteval detail::reference_t operator/(reference, U2) { return {}; } template - [[nodiscard]] friend consteval detail::reference_t<(get_quantity_spec(U1{}) / Q{}), (U1{} / U{})> operator/(U1, reference) + [[nodiscard]] friend consteval detail::reference_t operator/(U1, reference) { return {}; }