aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
diff options
context:
space:
mode:
authormikhnenko <mikhnenko@yandex-team.com>2023-11-07 19:02:37 +0300
committermikhnenko <mikhnenko@yandex-team.com>2023-11-07 19:40:24 +0300
commitc67f6bf0e38c3e450cf3fb320b3db868fd4b5fe8 (patch)
treed4662b2c9af0f2658f74c56d1d1e5cb672f34680 /contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
parentaa4bbf0349f5ee93d10e133c1d79cb5151f853f0 (diff)
downloadydb-c67f6bf0e38c3e450cf3fb320b3db868fd4b5fe8.tar.gz
Upd libc++ to 18 Jun 2022 ff3989e6ae740a9b3adaad0e2bf7691ffd6dad12
``` [libc++] Add Implemented Papers section [libc++] Enable -Wweak-vtables [libc++] Make sure we install libc++abi headers on Apple [libc++] Don't force -O2 when building the benchmarks [libc++] Mark standard-mandated includes as such [libc++] Implement std::boyer_moore{, _horspool}_searcher [libc++] Unwrap reverse_iterator<reverse_iterator<Iter>> in __unwrap_iter [libc++] Simplify __config a bit [libc++][ranges] Implement `ranges::sort`. [libc++] Remove now-unused experimental/filesystem config file [libc++] Robust against C++20-hostile iterators [libc++] Implement ranges::lexicographical_compare [libc++] Removes unneeded <iterator> includes. [libcxx] Fix allocator<void>::pointer in C++20 with removed members [libcxx] Remove extraneous '---' lines in .clang-format files [libc++][NFCI] span: replace enable_if with concepts [libc++] Find a clang-format everybody is happy with [libc++] Use explicit module cache path in tests [libc++] Remove macros for IBM compiler ```
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
index be33194164..7d1807b7bb 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/unwrap_iter.h
@@ -63,6 +63,22 @@ __unwrap_iter(_Iter __i) _NOEXCEPT
return _Impl::__apply(__i);
}
+template <class _OrigIter, class _UnwrappedIter>
+struct __rewrap_iter_impl {
+ static _LIBCPP_CONSTEXPR _OrigIter __apply(_OrigIter __first, _UnwrappedIter __result) {
+ // Precondition: __result is reachable from __first
+ // Precondition: _OrigIter is a contiguous iterator
+ return __first + (__result - std::__unwrap_iter(__first));
+ }
+};
+
+template <class _OrigIter>
+struct __rewrap_iter_impl<_OrigIter, _OrigIter> {
+ static _LIBCPP_CONSTEXPR _OrigIter __apply(_OrigIter, _OrigIter __result) {
+ return __result;
+ }
+};
+
template<class _OrigIter>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
_OrigIter __rewrap_iter(_OrigIter, _OrigIter __result)
@@ -70,13 +86,11 @@ _OrigIter __rewrap_iter(_OrigIter, _OrigIter __result)
return __result;
}
-template<class _OrigIter, class _UnwrappedIter>
+template<class _OrigIter, class _UnwrappedIter, class _Impl = __rewrap_iter_impl<_OrigIter, _UnwrappedIter> >
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
_OrigIter __rewrap_iter(_OrigIter __first, _UnwrappedIter __result)
{
- // Precondition: __result is reachable from __first
- // Precondition: _OrigIter is a contiguous iterator
- return __first + (__result - _VSTD::__unwrap_iter(__first));
+ return _Impl::__apply(__first, __result);
}
_LIBCPP_END_NAMESPACE_STD