From 7062a4f89ea459287af6da6cf7521ab8f239cabd Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 6 May 2019 22:39:59 -0600 Subject: [PATCH] fix unit template's mutating operators to give them proper ref qualifiers --- include/libtorrent/units.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/units.hpp b/include/libtorrent/units.hpp index dac07346a..a0c647ea5 100644 --- a/include/libtorrent/units.hpp +++ b/include/libtorrent/units.hpp @@ -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(rhs)}; } - strong_typedef& operator+=(diff_type rhs) + strong_typedef& operator+=(diff_type rhs) & { m_val += static_cast(rhs); return *this; } - strong_typedef& operator-=(diff_type rhs) + strong_typedef& operator-=(diff_type rhs) & { m_val -= static_cast(rhs); return *this; } strong_typedef& operator=(strong_typedef const& rhs) & noexcept = default;