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 };