mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 12:54:25 +02:00
feat: nodiscard for postfix increment and decrement
This commit is contained in:
committed by
Mateusz Pusz
parent
5cb6d93099
commit
69dddaf1f6
Submodule cmake/common updated: eb5fbd40d1...a12d699507
@@ -141,7 +141,7 @@ public:
|
||||
|
||||
template<typename T = Rep>
|
||||
requires requires(T v) { { v++ } -> SAME_AS(T); }
|
||||
constexpr quantity operator++(int)
|
||||
[[nodiscard]] constexpr quantity operator++(int)
|
||||
// requires requires(rep v) { { v++ } -> std::same_as<rep>; } // TODO gated by gcc-9 (fixed in gcc-10)
|
||||
{
|
||||
return quantity(value_++);
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
|
||||
template<typename T = Rep>
|
||||
requires requires(T v) { { v-- } -> SAME_AS(T); }
|
||||
constexpr quantity operator--(int)
|
||||
[[nodiscard]] constexpr quantity operator--(int)
|
||||
// requires requires(rep v) { { v-- } -> std::same_as<rep>; } // TODO gated by gcc-9 (fixed in gcc-10)
|
||||
{
|
||||
return quantity(value_--);
|
||||
|
Reference in New Issue
Block a user