diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /util/generic/iterator.h | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 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 19e9d20976..b34be9c28c 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; |