aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/iterator/mapped.h
diff options
context:
space:
mode:
authoreeight <eeight@yandex-team.ru>2022-02-10 16:46:18 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:18 +0300
commit475c0a46f28166e83fd263badc7546377cddcabe (patch)
tree39c5a49b8aaad78fe390b6f1f2886bdbda40f3e7 /library/cpp/iterator/mapped.h
parenta6e0145a095c7bb3770d6e07aee301de5c73f96e (diff)
downloadydb-475c0a46f28166e83fd263badc7546377cddcabe.tar.gz
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/iterator/mapped.h')
-rw-r--r--library/cpp/iterator/mapped.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/iterator/mapped.h b/library/cpp/iterator/mapped.h
index 6c5e763184..97c730b66d 100644
--- a/library/cpp/iterator/mapped.h
+++ b/library/cpp/iterator/mapped.h
@@ -6,7 +6,7 @@
#include <iterator>
-namespace NIteratorPrivate {
+namespace NIteratorPrivate {
template <class TIterator>
constexpr bool HasRandomAccess() {
return std::is_same_v<typename std::iterator_traits<TIterator>::iterator_category,
@@ -26,7 +26,7 @@ public:
using value_type = TValue;
using reference = TValue&;
using pointer = std::remove_reference_t<TValue>*;
- using iterator_category = std::conditional_t<NIteratorPrivate::HasRandomAccess<TIterator>(),
+ using iterator_category = std::conditional_t<NIteratorPrivate::HasRandomAccess<TIterator>(),
std::random_access_iterator_tag, std::input_iterator_tag>;
TMappedIterator(TIterator it, TMapper mapper)
@@ -122,10 +122,10 @@ public:
return {std::end(*Container.Ptr()), {*Mapper.Ptr()}};
}
- bool empty() const {
- return std::begin(*Container.Ptr()) == std::end(*Container.Ptr());
- }
-
+ bool empty() const {
+ return std::begin(*Container.Ptr()) == std::end(*Container.Ptr());
+ }
+
protected:
mutable TContainerStorage Container;
mutable TMapperStorage Mapper;
@@ -154,7 +154,7 @@ public:
using TBase::begin;
using TBase::end;
- using TBase::empty;
+ using TBase::empty;
size_type size() const {
return std::end(*this->Container.Ptr()) - std::begin(*this->Container.Ptr());
@@ -185,7 +185,7 @@ auto MakeMappedRange(TIterator begin, TIterator end, TMapper mapper) {
template <class TContainer, class TMapper>
auto MakeMappedRange(TContainer&& container, TMapper&& mapper) {
- if constexpr (NIteratorPrivate::HasRandomAccess<decltype(std::begin(container))>()) {
+ if constexpr (NIteratorPrivate::HasRandomAccess<decltype(std::begin(container))>()) {
return TRandomAccessMappedRange<TContainer, TMapper>(std::forward<TContainer>(container), std::forward<TMapper>(mapper));
} else {
return TInputMappedRange<TContainer, TMapper>(std::forward<TContainer>(container), std::forward<TMapper>(mapper));