aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/iterator_range.h
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:10 +0300
commitbaa58daefa91fde4b4769facdbd2903763b9c6a8 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/iterator_range.h
parent3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff)
downloadydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/iterator_range.h')
-rw-r--r--util/generic/iterator_range.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/generic/iterator_range.h b/util/generic/iterator_range.h
index d89eaf7559..9f4d02da29 100644
--- a/util/generic/iterator_range.h
+++ b/util/generic/iterator_range.h
@@ -1,7 +1,7 @@
#pragma once
-#include <util/system/yassert.h>
-
+#include <util/system/yassert.h>
+
#include <iterator>
#include <utility>
@@ -43,10 +43,10 @@ class TIteratorRange<TIterator, TIterator> {
public:
using iterator = TIterator;
using const_iterator = TIterator;
- using value_type = typename std::iterator_traits<iterator>::value_type;
- using reference = typename std::iterator_traits<iterator>::reference;
- using const_reference = typename std::iterator_traits<const_iterator>::reference;
- using difference_type = typename std::iterator_traits<iterator>::difference_type;
+ using value_type = typename std::iterator_traits<iterator>::value_type;
+ using reference = typename std::iterator_traits<iterator>::reference;
+ using const_reference = typename std::iterator_traits<const_iterator>::reference;
+ using difference_type = typename std::iterator_traits<iterator>::difference_type;
using size_type = std::size_t;
TIteratorRange()
@@ -74,15 +74,15 @@ public:
}
size_type size() const {
- return End_ - Begin_;
+ return End_ - Begin_;
+ }
+
+ reference operator[](size_t at) const {
+ Y_ASSERT(at < size());
+
+ return *(Begin_ + at);
}
- reference operator[](size_t at) const {
- Y_ASSERT(at < size());
-
- return *(Begin_ + at);
- }
-
private:
TIterator Begin_;
TIterator End_;