diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:40 +0300 |
commit | 5d50718e66d9c037dc587a0211110b7d25a66185 (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /util/generic/iterator.h | |
parent | a6a92afe03e02795227d2641b49819b687f088f8 (diff) | |
download | ydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/iterator.h')
-rw-r--r-- | util/generic/iterator.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/generic/iterator.h b/util/generic/iterator.h index b34be9c28c..19e9d20976 100644 --- a/util/generic/iterator.h +++ b/util/generic/iterator.h @@ -1,8 +1,8 @@ #pragma once #include <iterator> -#include <utility> - +#include <utility> + namespace NStlIterator { template <class T> class TProxy { @@ -68,31 +68,31 @@ class TInputRangeAdaptor { public: // TODO: private class TIterator { public: - static constexpr bool IsNoexceptNext = noexcept(std::declval<TSlave>().Next()); - + static constexpr bool IsNoexceptNext = noexcept(std::declval<TSlave>().Next()); + using difference_type = std::ptrdiff_t; using pointer = decltype(std::declval<TSlave>().Next()); using reference = decltype(*std::declval<TSlave>().Next()); using value_type = std::remove_cv_t<std::remove_reference_t<reference>>; using iterator_category = std::input_iterator_tag; - inline TIterator() noexcept + inline TIterator() noexcept : Slave_(nullptr) , Cur_() { } - inline TIterator(TSlave* slave) noexcept(IsNoexceptNext) + inline TIterator(TSlave* slave) noexcept(IsNoexceptNext) : Slave_(slave) , Cur_(Slave_->Next()) { } - inline bool operator==(const TIterator& it) const noexcept { + inline bool operator==(const TIterator& it) const noexcept { return Cur_ == it.Cur_; } - inline bool operator!=(const TIterator& it) const noexcept { + inline bool operator!=(const TIterator& it) const noexcept { return !(*this == it); } @@ -104,7 +104,7 @@ public: // TODO: private return *Cur_; } - inline TIterator& operator++() noexcept(IsNoexceptNext) { + inline TIterator& operator++() noexcept(IsNoexceptNext) { Cur_ = Slave_->Next(); return *this; |