From 9d085cbe7e6975a98b61e86141d52f2b35f80ac1 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 16 May 2023 15:00:18 +0200 Subject: [PATCH] refactor(example): `[[nodiscard]]` added for currency --- example/currency.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/currency.cpp b/example/currency.cpp index 17ae7384..c1527b6e 100644 --- a/example/currency.cpp +++ b/example/currency.cpp @@ -45,7 +45,7 @@ static_assert(!std::equality_comparable_with, quantity -double exchange_rate() +[[nodiscard]] double exchange_rate() { if constexpr (From == us_dollar && To == euro) return 0.9215; else if constexpr (From == euro && To == us_dollar) return 1.0848; @@ -54,10 +54,10 @@ double exchange_rate() #else -std::string_view to_string_view(Unit auto u) { return u.symbol.ascii().c_str(); } +[[nodiscard]] std::string_view to_string_view(Unit auto u) { return u.symbol.ascii().c_str(); } template -double exchange_rate() +[[nodiscard]] double exchange_rate() { static std::map, double> rates = { {{"USD", "EUR"}, 0.9215}, {{"EUR", "USD"}, 1.0848},