util/DereferenceIterator: optimize and simplify increment/decrement operators
This commit is contained in:
parent
fe66cde616
commit
cb9f3c1a5b
|
@ -44,7 +44,7 @@ public:
|
||||||
|
|
||||||
constexpr auto operator++(int) noexcept {
|
constexpr auto operator++(int) noexcept {
|
||||||
auto old = *this;
|
auto old = *this;
|
||||||
original++;
|
++original;
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,13 +58,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr auto &operator--() noexcept {
|
constexpr auto &operator--() noexcept {
|
||||||
original = --original;
|
--original;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr auto operator--(int) noexcept {
|
constexpr auto operator--(int) noexcept {
|
||||||
auto old = *this;
|
auto old = *this;
|
||||||
original--;
|
--original;
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue