From 0e974a7f32bdda938735f1c2d70bc8f5a75edbd5 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 13 Sep 2023 12:21:17 +0200 Subject: [PATCH] fix: hacks for clang-16 compilation added --- src/core/include/mp-units/unit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp-units/unit.h b/src/core/include/mp-units/unit.h index 98adfa06..a15b0f7c 100644 --- a/src/core/include/mp-units/unit.h +++ b/src/core/include/mp-units/unit.h @@ -402,7 +402,7 @@ using type_list_of_unit_less = expr_less; * Multiplication by `1` returns the same unit, otherwise `scaled_unit` is being returned. */ template -[[nodiscard]] consteval Unit auto operator*(M mag, const U u) +[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator*(M mag, const U u) { if constexpr (mag == mp_units::mag<1>) return u; @@ -418,7 +418,7 @@ template * to the derived unit and the magnitude remains outside forming another scaled unit as a result of the operation. */ template -[[nodiscard]] consteval Unit auto operator*(Lhs lhs, Rhs rhs) +[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator*(Lhs lhs, Rhs rhs) { if constexpr (detail::is_specialization_of_scaled_unit && detail::is_specialization_of_scaled_unit) return (Lhs::mag * Rhs::mag) * (Lhs::reference_unit * Rhs::reference_unit); @@ -436,7 +436,7 @@ template * to the derived unit and the magnitude remains outside forming another scaled unit as a result of the operation. */ template -[[nodiscard]] consteval Unit auto operator/(Lhs lhs, Rhs rhs) +[[nodiscard]] MP_UNITS_CONSTEVAL Unit auto operator/(Lhs lhs, Rhs rhs) { if constexpr (detail::is_specialization_of_scaled_unit && detail::is_specialization_of_scaled_unit) return (Lhs::mag / Rhs::mag) * (Lhs::reference_unit / Rhs::reference_unit);