From f37ec4c62b708a354de6538f2893378d4ce9cb2f Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 16 Dec 2022 18:18:14 +0100 Subject: [PATCH] refactor: missing `nodiscard`s added to functions in _unit.h_ --- src/core/include/units/unit.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/include/units/unit.h b/src/core/include/units/unit.h index c36c402a..edb70196 100644 --- a/src/core/include/units/unit.h +++ b/src/core/include/units/unit.h @@ -592,29 +592,30 @@ template namespace detail { -consteval bool same_canonical_reference_unit(...) { return false; } +[[nodiscard]] consteval bool same_canonical_reference_unit(...) { return false; } template -consteval bool same_canonical_reference_unit(const named_unit&, const named_unit&) +[[nodiscard]] consteval bool same_canonical_reference_unit(const named_unit&, + const named_unit&) { return true; } template -consteval bool same_canonical_reference_unit(const power&, const power&) +[[nodiscard]] consteval bool same_canonical_reference_unit(const power&, const power&) { return same_canonical_reference_unit(F1{}, F2{}); } template requires(sizeof...(Us1) == sizeof...(Us2)) -consteval bool same_canonical_reference_unit(const type_list&, const type_list&) +[[nodiscard]] consteval bool same_canonical_reference_unit(const type_list&, const type_list&) { return (... && same_canonical_reference_unit(Us1{}, Us2{})); } template -consteval bool same_canonical_reference_unit(const derived_unit&, const derived_unit&) +[[nodiscard]] consteval bool same_canonical_reference_unit(const derived_unit&, const derived_unit&) { return same_canonical_reference_unit(typename derived_unit::_num_{}, typename derived_unit::_num_{}) &&