From 6c5d763fbb07e712460caa04992ccd0e2d9af9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Mon, 17 Aug 2020 22:27:26 -0400 Subject: [PATCH] refactor: nodiscard to functions --- src/include/units/quantity_point.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/units/quantity_point.h b/src/include/units/quantity_point.h index 0b06548c..886ae87d 100644 --- a/src/include/units/quantity_point.h +++ b/src/include/units/quantity_point.h @@ -38,7 +38,7 @@ namespace units { * @tparam Rep a type to be used to represent values of a quantity point */ template U, Scalar Rep = double> -class [[nodiscard]] quantity_point { +class quantity_point { public: using quantity_type = quantity; using dimension = typename quantity_type::dimension; @@ -67,7 +67,7 @@ public: [[nodiscard]] constexpr quantity_type relative() const noexcept { return q_; } template - static constexpr quantity_point min() noexcept + [[nodiscard]] static constexpr quantity_point min() noexcept requires requires { Q::min(); } // requires requires { quantity_type::min(); } // TODO gated by gcc-9 (fixed in gcc-10) { @@ -75,7 +75,7 @@ public: } template - static constexpr quantity_point max() noexcept + [[nodiscard]] static constexpr quantity_point max() noexcept requires requires { Q::max(); } // requires requires { quantity_type::max(); } // TODO gated by gcc-9 (fixed in gcc-10) { @@ -93,7 +93,7 @@ public: template requires requires(Q q) { q++; } - constexpr quantity_point operator++(int) + [[nodiscard]] constexpr quantity_point operator++(int) // requires requires(quantity_type q) { q++; } // TODO gated by gcc-9 (fixed in gcc-10) { return quantity_point(q_++); @@ -110,7 +110,7 @@ public: template requires requires(Q q) { q--; } - constexpr quantity_point operator--(int) + [[nodiscard]] constexpr quantity_point operator--(int) // requires requires(quantity_type q) { q--; } // TODO gated by gcc-9 (fixed in gcc-10) { return quantity_point(q_--);