From e61bfafd298f0077d194a473d3b2bf489caac26c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 22 Dec 2022 21:28:03 +0100 Subject: [PATCH] fix: `consteval` replaced with `constexpr` for `quantity_spec::operator()` --- src/core/include/units/quantity_spec.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/include/units/quantity_spec.h b/src/core/include/units/quantity_spec.h index 5efdd8a6..46264df5 100644 --- a/src/core/include/units/quantity_spec.h +++ b/src/core/include/units/quantity_spec.h @@ -213,10 +213,10 @@ struct derived_quantity_spec : detail::expr_fractions, Q #endif template Rep, Unit U> - [[nodiscard]] consteval Quantity auto operator()(Rep&& v, U u) const + [[nodiscard]] constexpr Quantity auto operator()(Rep&& v, U u) const requires(dimension == detail::get_dimension_for(u)) { - return (*this)[u](std::forward(v)); + return derived_quantity_spec{}[u](std::forward(v)); } }; @@ -302,10 +302,10 @@ struct quantity_spec { } template Rep, Unit U> - [[nodiscard]] consteval Quantity auto operator()(Rep&& v, U u) const + [[nodiscard]] constexpr Quantity auto operator()(Rep&& v, U u) const requires(dimension == detail::get_dimension_for(u)) { - return (*this)[u](std::forward(v)); + return Self{}[u](std::forward(v)); } }; @@ -371,10 +371,10 @@ struct quantity_spec : std::remove_const_t { } template Rep, Unit U> - [[nodiscard]] consteval Quantity auto operator()(Rep&& v, U u) const + [[nodiscard]] constexpr Quantity auto operator()(Rep&& v, U u) const requires(this->dimension == detail::get_dimension_for(u)) { - return (*this)[u](std::forward(v)); + return Self{}[u](std::forward(v)); } #endif };