diff options
author | swarmer <swarmer@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
commit | 11a24635da4c4f39428b182c49a7bc35e47c9534 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/xrange.h | |
parent | 317da38588b7898a99fd9168571408123350012b (diff) | |
download | ydb-11a24635da4c4f39428b182c49a7bc35e47c9534.tar.gz |
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/xrange.h')
-rw-r--r-- | util/generic/xrange.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/util/generic/xrange.h b/util/generic/xrange.h index 4d9c3090010..5fc8c829121 100644 --- a/util/generic/xrange.h +++ b/util/generic/xrange.h @@ -85,12 +85,12 @@ namespace NPrivate { return TIterator(Value - b); } - template <typename IntType> - TIterator& operator-=(const IntType& b) noexcept { - Value -= b; - return *this; - } - + template <typename IntType> + TIterator& operator-=(const IntType& b) noexcept { + Value -= b; + return *this; + } + constexpr bool operator<(const TIterator& b) const noexcept { return Value < b.Value; } @@ -175,31 +175,31 @@ namespace NPrivate { } constexpr TDiff operator-(const TIterator& b) const noexcept { - return (Value_ - b.Value_) / Parent_->Step_; + return (Value_ - b.Value_) / Parent_->Step_; } template <typename IntType> constexpr TIterator operator+(const IntType& b) const noexcept { - return TIterator(*this) += b; + return TIterator(*this) += b; } template <typename IntType> TIterator& operator+=(const IntType& b) noexcept { - Value_ += b * Parent_->Step_; + Value_ += b * Parent_->Step_; return *this; } template <typename IntType> constexpr TIterator operator-(const IntType& b) const noexcept { - return TIterator(*this) -= b; + return TIterator(*this) -= b; + } + + template <typename IntType> + TIterator& operator-=(const IntType& b) noexcept { + Value_ -= b * Parent_->Step_; + return *this; } - template <typename IntType> - TIterator& operator-=(const IntType& b) noexcept { - Value_ -= b * Parent_->Step_; - return *this; - } - private: T Value_; const TSteppedXRange* Parent_; |