From bcaccccc7aec619b6cc35d527af0ffc4fd255570 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 16 Dec 2020 17:58:02 +0100 Subject: [PATCH] refactor: `abs()` defnition refactored to be more explicit about the return type --- src/include/units/math.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/units/math.h b/src/include/units/math.h index 4275c085..534c0c0a 100644 --- a/src/include/units/math.h +++ b/src/include/units/math.h @@ -91,11 +91,11 @@ template * @param q Quantity being the base of the operation * @return Quantity The absolute value of a provided quantity */ -template -[[nodiscard]] inline Quantity auto abs(const Q& q) noexcept +template +[[nodiscard]] inline quantity abs(const quantity& q) noexcept requires requires { std::abs(q.count()); } { - return Q(std::abs(q.count())); + return quantity(std::abs(q.count())); } /**