We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0313cbf commit 529b25eCopy full SHA for 529b25e
include/strong_type/strong_type.hpp
@@ -603,22 +603,23 @@ struct decrementable
603
class modifier
604
{
605
public:
606
+ friend
607
STRONG_CONSTEXPR
608
T&
- operator--()
609
+ operator--(T& t)
610
noexcept(noexcept(--std::declval<T&>().value_of()))
611
- auto &self = static_cast<T&>(*this);
612
- --value_of(self);
613
- return self;
+ --value_of(t);
+ return t;
614
}
615
616
617
618
T
- operator--(int)
619
+ operator--(T& t, int)
620
- auto copy = static_cast<T&>(*this);
621
- --*this;
+ auto copy = t;
622
+ --t;
623
return copy;
624
625
};
0 commit comments