fix unit template's mutating operators to give them proper ref qualifiers

This commit is contained in:
Arvid Norberg 2019-05-06 22:39:59 -06:00 committed by Arvid Norberg
parent 02c9e2f7ff
commit 7062a4f89e
1 changed files with 4 additions and 4 deletions

View File

@ -71,8 +71,8 @@ namespace libtorrent { namespace aux {
strong_typedef& operator++() { ++m_val; return *this; }
strong_typedef& operator--() { --m_val; return *this; }
strong_typedef operator++(int) { return strong_typedef{m_val++}; }
strong_typedef operator--(int) { return strong_typedef{m_val--}; }
strong_typedef operator++(int) & { return strong_typedef{m_val++}; }
strong_typedef operator--(int) & { return strong_typedef{m_val--}; }
friend diff_type operator-(strong_typedef lhs, strong_typedef rhs)
{ return diff_type{lhs.m_val - rhs.m_val}; }
@ -83,9 +83,9 @@ namespace libtorrent { namespace aux {
friend strong_typedef operator-(strong_typedef lhs, diff_type rhs)
{ return strong_typedef{lhs.m_val - static_cast<UnderlyingType>(rhs)}; }
strong_typedef& operator+=(diff_type rhs)
strong_typedef& operator+=(diff_type rhs) &
{ m_val += static_cast<UnderlyingType>(rhs); return *this; }
strong_typedef& operator-=(diff_type rhs)
strong_typedef& operator-=(diff_type rhs) &
{ m_val -= static_cast<UnderlyingType>(rhs); return *this; }
strong_typedef& operator=(strong_typedef const& rhs) & noexcept = default;