diff options
author | mikhnenko <[email protected]> | 2023-10-25 20:25:30 +0300 |
---|---|---|
committer | mikhnenko <[email protected]> | 2023-10-25 20:54:14 +0300 |
commit | 4e197a976205a88dd1de940b253acb2175dc47b8 (patch) | |
tree | a9cfdcc08abde7dd5206d62d23ecadd22b69238b /contrib/libs/cxxsupp/libcxx/include/iterator | |
parent | a2c311b015e4e9366b8da29d07f77cd4b92c1cb0 (diff) |
Upd libc++ to 1 Jun 2022 10c4eec2785a68880c287d36c262d5be3a72a128
[libc++][format] Fixes string-literal formatting.
[libc++] Removes __cpp_lib_monadic_optional.
[libcxx] Temporarily skip Arm configs
[libc++] Reduce the verbosity when running the libc++ Lit configuration
[libc++] Adds __format_string as nasty macro.
[libc++] Use __enable_if_t and is_integral in cstddef
[libc++] Adds missing includes.
[libc++] Minor emscripten changes from downstream
[libc++] Granularize more of <type_traits>
[libc++] Remove unused __functional includes
[libc++] Add various missing _LIBCPP_HIDE_FROM_ABI
[libc++] Use __libcpp_clz for a tighter __log2i function
[libc++] Enable ranges_robust_against* and niebloid tests for implemented ranges algorithms
[libc++] Implement ranges::is_sorted{, _until}
[libc++] Time tests during CI
[libc++] Implement ranges::{all, any, none}_of
[libc++] Remove temporary workaround for existing CMake caches
[libc++] Implement ranges::equal
[libc++] Remove conditional include
[libc++] Use Python subprocess instead of libc++'s own utilities
[libc++] Implement ranges::fill{, _n}
[libc++] Make sure that all headers can be included with modules enabled
[libc++] Rename the generic-singlethreaded CI job to generic-no-threads for consistency
[libc++] Implement ranges::reverse
[libc++] Replace modulus operations in std::seed_seq::generate with conditional checks.
[libc++] type_traits: use __is_core_convertible in __invokable_r.
[libc++] Remove duplicate tests for callable concepts
[libc++] Add ranges::max_element to the synopsis and ADL-proof the __min_element_impl calls
[libc++] Add auto to the list of required extensions in C++03
[libc++] Assume that push_macro and pop_macro are available
[libc++] Always enable the ranges concepts
[libc++] Granularize parts of <type_traits>
[libc++] Improve error messages for disabled modes
[libc++] Override the value of LIBCXX_CXX_ABI in the cache
[libc++] Granularize algorithm benchmarks
[libc++] Enable move semantics for vector in C++03
[libc++][format][5/6] Improve format_to_n.
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/iterator')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/iterator | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/iterator b/contrib/libs/cxxsupp/libcxx/include/iterator index 1f0390e83a5..30c9a10139f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/iterator +++ b/contrib/libs/cxxsupp/libcxx/include/iterator @@ -386,12 +386,13 @@ constexpr insert_iterator<Container> inserter(Container& x, ranges::iterator_t<C template <class Iterator> class move_iterator { public: - typedef Iterator iterator_type; - typedef typename iterator_traits<Iterator>::difference_type difference_type; - typedef Iterator pointer; - typedef typename iterator_traits<Iterator>::value_type value_type; - typedef typename iterator_traits<Iterator>::iterator_category iterator_category; - typedef value_type&& reference; + using iterator_type = Iterator; + using iterator_concept = input_iterator_tag; // From C++20 + using iterator_category = see below; // not always present starting from C++20 + using value_type = iter_value_t<Iterator>; // Until C++20, iterator_traits<Iterator>::value_type + using difference_type = iter_difference_t<Iterator>; // Until C++20, iterator_traits<Iterator>::difference_type; + using pointer = Iterator; + using reference = iter_rvalue_reference_t<Iterator>; // Until C++20, value_type&& constexpr move_iterator(); // all the constexprs are in C++17 constexpr explicit move_iterator(Iterator i); @@ -399,18 +400,40 @@ public: constexpr move_iterator(const move_iterator<U>& u); template <class U> constexpr move_iterator& operator=(const move_iterator<U>& u); - constexpr iterator_type base() const; + + constexpr iterator_type base() const; // Until C++20 + constexpr const Iterator& base() const & noexcept; // From C++20 + constexpr Iterator base() &&; // From C++20 + constexpr reference operator*() const; - constexpr pointer operator->() const; + constexpr pointer operator->() const; // Removed in C++20 constexpr move_iterator& operator++(); - constexpr move_iterator operator++(int); + constexpr auto operator++(int); // Return type was move_iterator until C++20 constexpr move_iterator& operator--(); constexpr move_iterator operator--(int); constexpr move_iterator operator+(difference_type n) const; constexpr move_iterator& operator+=(difference_type n); constexpr move_iterator operator-(difference_type n) const; constexpr move_iterator& operator-=(difference_type n); - constexpr unspecified operator[](difference_type n) const; + constexpr reference operator[](difference_type n) const; // Return type unspecified until C++20 + + template<sentinel_for<Iterator> S> + friend constexpr bool + operator==(const move_iterator& x, const move_sentinel<S>& y); // Since C++20 + template<sized_sentinel_for<Iterator> S> + friend constexpr iter_difference_t<Iterator> + operator-(const move_sentinel<S>& x, const move_iterator& y); // Since C++20 + template<sized_sentinel_for<Iterator> S> + friend constexpr iter_difference_t<Iterator> + operator-(const move_iterator& x, const move_sentinel<S>& y); // Since C++20 + friend constexpr iter_rvalue_reference_t<Iterator> + iter_move(const move_iterator& i) + noexcept(noexcept(ranges::iter_move(i.current))); // Since C++20 + template<indirectly_swappable<Iterator> Iterator2> + friend constexpr void + iter_swap(const move_iterator& x, const move_iterator<Iterator2>& y) + noexcept(noexcept(ranges::iter_swap(x.current, y.current))); // Since C++20 + private: Iterator current; // exposition only }; @@ -452,6 +475,23 @@ constexpr move_iterator<Iterator> operator+( // constexpr in C++17 template <class Iterator> // constexpr in C++17 constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i); +template<semiregular S> +class move_sentinel { +public: + constexpr move_sentinel(); + constexpr explicit move_sentinel(S s); + template<class S2> + requires convertible_to<const S2&, S> + constexpr move_sentinel(const move_sentinel<S2>& s); + template<class S2> + requires assignable_from<S&, const S2&> + constexpr move_sentinel& operator=(const move_sentinel<S2>& s); + + constexpr S base() const; +private: + S last; // exposition only +}; + // [default.sentinel], default sentinel struct default_sentinel_t; inline constexpr default_sentinel_t default_sentinel{}; @@ -684,12 +724,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept; #include <version> // TODO: remove these headers -#include <__functional/binary_function.h> -#include <__functional/invoke.h> -#include <__functional/operations.h> -#include <__functional/reference_wrapper.h> -#include <__functional/unary_function.h> -#include <__functional/weak_result_type.h> #include <__memory/allocator_arg_t.h> #include <__memory/uses_allocator.h> #include <exception> |