From 031fa62e36444b9dec40848b0c6997195d6db733 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 22 Apr 2024 19:22:01 +0200 Subject: [PATCH] refactor: `reference` returns `auto` to improve compilation times --- src/core/include/mp-units/reference.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/include/mp-units/reference.h b/src/core/include/mp-units/reference.h index 047f13c4..c1fa8b95 100644 --- a/src/core/include/mp-units/reference.h +++ b/src/core/include/mp-units/reference.h @@ -112,7 +112,7 @@ struct reference { return {}; } - [[nodiscard]] friend consteval detail::reference_t inverse(reference) { return {}; } + [[nodiscard]] friend consteval auto inverse(reference) { return detail::reference_t{}; } /** * @brief Computes the value of a reference raised to the `Num/Den` power @@ -125,9 +125,9 @@ struct reference { */ template requires detail::non_zero - [[nodiscard]] friend consteval detail::reference_t(Q{}), pow(U{})> pow(reference) + [[nodiscard]] friend consteval auto pow(reference) { - return {}; + return detail::reference_t(Q{}), pow(U{})>{}; } /** @@ -137,7 +137,7 @@ struct reference { * * @return The result of computation */ - [[nodiscard]] friend consteval detail::reference_t sqrt(reference) { return {}; } + [[nodiscard]] friend consteval auto sqrt(reference) { return detail::reference_t{}; } /** * @brief Computes the cubic root of a reference @@ -146,7 +146,7 @@ struct reference { * * @return The result of computation */ - [[nodiscard]] friend consteval detail::reference_t cbrt(reference) { return {}; } + [[nodiscard]] friend consteval auto cbrt(reference) { return detail::reference_t{}; } template [[nodiscard]] friend consteval bool convertible(reference, reference)