diff options
author | 2019-02-04 16:55:44 +0000 | |
---|---|---|
committer | 2019-02-04 16:55:44 +0000 | |
commit | 76c648e7a477ffb2a882ad5ffe523269bd9a3f6a (patch) | |
tree | 29d319d598650bab04e4f58e5e8769567e33091e /lib/libcxx/include/algorithm | |
parent | Import libc++abi 7.0.1. (diff) | |
download | wireguard-openbsd-76c648e7a477ffb2a882ad5ffe523269bd9a3f6a.tar.xz wireguard-openbsd-76c648e7a477ffb2a882ad5ffe523269bd9a3f6a.zip |
Import libc++ 7.0.1.
Diffstat (limited to 'lib/libcxx/include/algorithm')
-rw-r--r-- | lib/libcxx/include/algorithm | 508 |
1 files changed, 212 insertions, 296 deletions
diff --git a/lib/libcxx/include/algorithm b/lib/libcxx/include/algorithm index 35c6129ea50..90f1d246c63 100644 --- a/lib/libcxx/include/algorithm +++ b/lib/libcxx/include/algorithm @@ -20,149 +20,150 @@ namespace std { template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 all_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 any_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 none_of(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator, class Function> - Function + constexpr Function // constexpr in C++20 for_each(InputIterator first, InputIterator last, Function f); template<class InputIterator, class Size, class Function> - InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17 + constexpr InputIterator // constexpr in C++20 + for_each_n(InputIterator first, Size n, Function f); // C++17 template <class InputIterator, class T> - InputIterator + constexpr InputIterator // constexpr in C++20 find(InputIterator first, InputIterator last, const T& value); template <class InputIterator, class Predicate> - InputIterator + constexpr InputIterator // constexpr in C++20 find_if(InputIterator first, InputIterator last, Predicate pred); template<class InputIterator, class Predicate> - InputIterator + InputIterator // constexpr in C++20 find_if_not(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 adjacent_find(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class BinaryPredicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); template <class InputIterator, class T> - typename iterator_traits<InputIterator>::difference_type + constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 count(InputIterator first, InputIterator last, const T& value); template <class InputIterator, class Predicate> - typename iterator_traits<InputIterator>::difference_type + constexpr typename iterator_traits<InputIterator>::difference_type // constexpr in C++20 count_if(InputIterator first, InputIterator last, Predicate pred); template <class InputIterator1, class InputIterator2> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); template <class InputIterator1, class InputIterator2> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); // **C++14** template <class InputIterator1, class InputIterator2, class BinaryPredicate> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred); template <class InputIterator1, class InputIterator2, class BinaryPredicate> - pair<InputIterator1, InputIterator2> + constexpr pair<InputIterator1, InputIterator2> // constexpr in C++20 mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred); // **C++14** template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); // **C++14** template <class InputIterator1, class InputIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred); template <class InputIterator1, class InputIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred); // **C++14** template<class ForwardIterator1, class ForwardIterator2> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); template<class ForwardIterator1, class ForwardIterator2> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); // **C++14** template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, BinaryPredicate pred); template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - bool + constexpr bool // constexpr in C++20 is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); // **C++14** template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 + constexpr ForwardIterator1 // constexpr in C++20 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); template <class ForwardIterator, class Size, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); template <class ForwardIterator, class Size, class T, class BinaryPredicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value, BinaryPredicate pred); @@ -193,61 +194,61 @@ template <class ForwardIterator1, class ForwardIterator2> iter_swap(ForwardIterator1 a, ForwardIterator2 b); template <class InputIterator, class OutputIterator, class UnaryOperation> - OutputIterator + constexpr OutputIterator // constexpr in C++20 transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op); template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> - OutputIterator + constexpr OutputIterator // constexpr in C++20 transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryOperation binary_op); template <class ForwardIterator, class T> - void + constexpr void // constexpr in C++20 replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value); template <class ForwardIterator, class Predicate, class T> - void + constexpr void // constexpr in C++20 replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); template <class InputIterator, class OutputIterator, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 replace_copy(InputIterator first, InputIterator last, OutputIterator result, const T& old_value, const T& new_value); template <class InputIterator, class OutputIterator, class Predicate, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value); template <class ForwardIterator, class T> - void + constexpr void // constexpr in C++20 fill(ForwardIterator first, ForwardIterator last, const T& value); template <class OutputIterator, class Size, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 fill_n(OutputIterator first, Size n, const T& value); template <class ForwardIterator, class Generator> - void + constexpr void // constexpr in C++20 generate(ForwardIterator first, ForwardIterator last, Generator gen); template <class OutputIterator, class Size, class Generator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 generate_n(OutputIterator first, Size n, Generator gen); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 remove(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class Predicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 remove_if(ForwardIterator first, ForwardIterator last, Predicate pred); template <class InputIterator, class OutputIterator, class T> - OutputIterator + constexpr OutputIterator // constexpr in C++20 remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); template <class InputIterator, class OutputIterator, class Predicate> - OutputIterator + constexpr OutputIterator // constexpr in C++20 remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); template <class ForwardIterator> @@ -271,7 +272,7 @@ template <class BidirectionalIterator> reverse(BidirectionalIterator first, BidirectionalIterator last); template <class BidirectionalIterator, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); template <class ForwardIterator> @@ -302,7 +303,7 @@ template<class RandomAccessIterator, class UniformRandomNumberGenerator> UniformRandomNumberGenerator&& g); template <class InputIterator, class Predicate> - bool + constexpr bool // constexpr in C++20 is_partitioned(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator, class Predicate> @@ -311,7 +312,7 @@ template <class ForwardIterator, class Predicate> template <class InputIterator, class OutputIterator1, class OutputIterator2, class Predicate> - pair<OutputIterator1, OutputIterator2> + constexpr pair<OutputIterator1, OutputIterator2> // constexpr in C++20 partition_copy(InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); @@ -321,11 +322,11 @@ template <class ForwardIterator, class Predicate> stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred); template<class ForwardIterator, class Predicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); template <class ForwardIterator> - bool + constexpr bool // constexpr in C++20 is_sorted(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> @@ -333,11 +334,11 @@ template <class ForwardIterator, class Compare> is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); template<class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); template <class RandomAccessIterator> @@ -383,35 +384,35 @@ template <class RandomAccessIterator, class Compare> nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 lower_bound(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 upper_bound(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - pair<ForwardIterator, ForwardIterator> + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 equal_range(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - pair<ForwardIterator, ForwardIterator> + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++20 equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class ForwardIterator, class T> - bool + constexpr bool // constexpr in C++20 binary_search(ForwardIterator first, ForwardIterator last, const T& value); template <class ForwardIterator, class T, class Compare> - bool + constexpr bool // constexpr in C++20 binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> @@ -433,11 +434,11 @@ template <class BidirectionalIterator, class Compare> inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); template <class InputIterator1, class InputIterator2, class Compare> - bool + constexpr bool // constexpr in C++20 includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> @@ -451,12 +452,12 @@ template <class InputIterator1, class InputIterator2, class OutputIterator, clas InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_intersection(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result); template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_intersection(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); @@ -513,19 +514,19 @@ template <class RandomAccessIterator, class Compare> sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - bool + constexpr bool // constexpr in C++20 is_heap(RandomAccessIterator first, RandomAccessiterator last); template <class RandomAccessIterator, class Compare> - bool + constexpr bool // constexpr in C++20 is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template <class RandomAccessIterator> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 is_heap_until(RandomAccessIterator first, RandomAccessiterator last); template <class RandomAccessIterator, class Compare> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template <class ForwardIterator> @@ -607,11 +608,11 @@ template<class T, class Compare> minmax(initializer_list<T> t, Compare comp); // constexpr in C++14 template <class InputIterator1, class InputIterator2> - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); template <class InputIterator1, class InputIterator2, class Compare> - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); @@ -641,6 +642,7 @@ template <class BidirectionalIterator, class Compare> #include <cstring> #include <utility> // needed to provide swap_ranges. #include <memory> +#include <functional> #include <iterator> #include <cstddef> @@ -669,10 +671,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _T1, class _T2 = _T1> struct __equal_to { - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} }; template <class _T1> @@ -918,7 +920,7 @@ inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) { // all_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -931,7 +933,7 @@ all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // any_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -944,7 +946,7 @@ any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // none_of template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -957,7 +959,7 @@ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // for_each template <class _InputIterator, class _Function> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first, _InputIterator __last, _Function __f) { @@ -970,7 +972,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f) // for_each_n template <class _InputIterator, class _Size, class _Function> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) { @@ -989,7 +991,7 @@ for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) // find template <class _InputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { @@ -1002,7 +1004,7 @@ find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) // find_if template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1015,7 +1017,7 @@ find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) // find_if_not template<class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1028,7 +1030,7 @@ find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) // find_end template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -_ForwardIterator1 +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) @@ -1070,7 +1072,7 @@ __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2> -_BidirectionalIterator1 +_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1 __find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred, bidirectional_iterator_tag, bidirectional_iterator_tag) @@ -1150,7 +1152,7 @@ __find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1162,7 +1164,7 @@ find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1188,7 +1190,7 @@ __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1197,7 +1199,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1210,7 +1212,7 @@ find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, // adjacent_find template <class _ForwardIterator, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { @@ -1228,7 +1230,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicat } template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator adjacent_find(_ForwardIterator __first, _ForwardIterator __last) { @@ -1239,7 +1241,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last) // count template <class _InputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { @@ -1253,7 +1255,7 @@ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) // count_if template <class _InputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { @@ -1267,7 +1269,7 @@ count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) // mismatch template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) @@ -1279,7 +1281,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { @@ -1290,7 +1292,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi #if _LIBCPP_STD_VER > 11 template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, @@ -1303,7 +1305,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) @@ -1317,7 +1319,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, // equal template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { @@ -1328,7 +1330,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { @@ -1339,7 +1341,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first #if _LIBCPP_STD_VER > 11 template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred, @@ -1352,7 +1354,7 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, @@ -1366,7 +1368,7 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred ) @@ -1378,7 +1380,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) @@ -1394,17 +1396,18 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, // is_permutation template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { - // shorten sequences as much as possible by lopping of any equal parts +// shorten sequences as much as possible by lopping of any equal prefix for (; __first1 != __last1; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) - goto __not_done; - return true; -__not_done: - // __first1 != __last1 && *__first1 != *__first2 + break; + if (__first1 == __last1) + return true; + +// __first1 != __last1 && *__first1 != *__first2 typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; _D1 __l1 = _VSTD::distance(__first1, __last1); if (__l1 == _D1(1)) @@ -1414,11 +1417,12 @@ __not_done: // equal elements in [f2, l2) for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { - // Have we already counted the number of *__i in [f1, l1)? - for (_ForwardIterator1 __j = __first1; __j != __i; ++__j) - if (__pred(*__j, *__i)) - goto __next_iter; - { + // Have we already counted the number of *__i in [f1, l1)? + _ForwardIterator1 __match = __first1; + for (; __match != __i; ++__match) + if (__pred(*__match, *__i)) + break; + if (__match == __i) { // Count number of *__i in [f2, l2) _D1 __c2 = 0; for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) @@ -1434,13 +1438,12 @@ __not_done: if (__c1 != __c2) return false; } -__next_iter:; } return true; } template<class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) @@ -1452,19 +1455,21 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, #if _LIBCPP_STD_VER > 11 template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag ) { - // shorten sequences as much as possible by lopping of any equal parts +// shorten sequences as much as possible by lopping of any equal prefix for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) - goto __not_done; - return __first1 == __last1 && __first2 == __last2; -__not_done: - // __first1 != __last1 && __first2 != __last2 && *__first1 != *__first2 + break; + if (__first1 == __last1) + return __first2 == __last2; + else if (__first2 == __last2) + return false; + typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; _D1 __l1 = _VSTD::distance(__first1, __last1); @@ -1477,11 +1482,12 @@ __not_done: // equal elements in [f2, l2) for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { - // Have we already counted the number of *__i in [f1, l1)? - for (_ForwardIterator1 __j = __first1; __j != __i; ++__j) - if (__pred(*__j, *__i)) - goto __next_iter; - { + // Have we already counted the number of *__i in [f1, l1)? + _ForwardIterator1 __match = __first1; + for (; __match != __i; ++__match) + if (__pred(*__match, *__i)) + break; + if (__match == __i) { // Count number of *__i in [f2, l2) _D1 __c2 = 0; for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) @@ -1497,13 +1503,12 @@ __not_done: if (__c1 != __c2) return false; } -__next_iter:; } return true; } template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, @@ -1517,7 +1522,7 @@ __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1 } template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, @@ -1530,7 +1535,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template<class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1545,91 +1550,10 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, #endif // search - -template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -pair<_ForwardIterator1, _ForwardIterator1> -__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, - forward_iterator_tag, forward_iterator_tag) -{ - if (__first2 == __last2) - return make_pair(__first1, __first1); // Everything matches an empty sequence - while (true) - { - // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks - while (true) - { - if (__first1 == __last1) // return __last1 if no element matches *__first2 - return make_pair(__last1, __last1); - if (__pred(*__first1, *__first2)) - break; - ++__first1; - } - // *__first1 matches *__first2, now match elements after here - _ForwardIterator1 __m1 = __first1; - _ForwardIterator2 __m2 = __first2; - while (true) - { - if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern) - return make_pair(__first1, __m1); - if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found - return make_pair(__last1, __last1); - if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1 - { - ++__first1; - break; - } // else there is a match, check next elements - } - } -} - -template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX11 -pair<_RandomAccessIterator1, _RandomAccessIterator1> -__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, - random_access_iterator_tag, random_access_iterator_tag) -{ - typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1; - typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2; - // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern - const _D2 __len2 = __last2 - __first2; - if (__len2 == 0) - return make_pair(__first1, __first1); - const _D1 __len1 = __last1 - __first1; - if (__len1 < __len2) - return make_pair(__last1, __last1); - const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here - - while (true) - { - while (true) - { - if (__first1 == __s) - return make_pair(__last1, __last1); - if (__pred(*__first1, *__first2)) - break; - ++__first1; - } - - _RandomAccessIterator1 __m1 = __first1; - _RandomAccessIterator2 __m2 = __first2; - while (true) - { - if (++__m2 == __last2) - return make_pair(__first1, __first1 + __len2); - ++__m1; // no need to check range on __m1 because __s guarantees we have enough source - if (!__pred(*__m1, *__m2)) - { - ++__first1; - break; - } - } - } -} +// __search is in <functional> template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) @@ -1642,7 +1566,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, } template <class _ForwardIterator1, class _ForwardIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) @@ -1652,10 +1576,18 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); } + +#if _LIBCPP_STD_VER > 14 +template <class _ForwardIterator, class _Searcher> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) +{ return __s(__f, __l).first; } +#endif + // search_n template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag) { @@ -1692,7 +1624,7 @@ __search_n(_ForwardIterator __first, _ForwardIterator __last, } template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp> -_RandomAccessIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag) { @@ -1732,7 +1664,7 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, } template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred) @@ -1743,7 +1675,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last, } template <class _ForwardIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) { @@ -1776,7 +1708,7 @@ __unwrap_iter(move_iterator<_Tp*> __i) #if _LIBCPP_DEBUG_LEVEL < 2 template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1790,7 +1722,7 @@ __unwrap_iter(__wrap_iter<_Tp*> __i) #else template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -2023,7 +1955,7 @@ move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, // transform template <class _InputIterator, class _OutputIterator, class _UnaryOperation> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op) { @@ -2033,7 +1965,7 @@ transform(_InputIterator __first, _InputIterator __last, _OutputIterator __resul } template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _BinaryOperation __binary_op) @@ -2046,7 +1978,7 @@ transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __f // replace template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) { @@ -2058,7 +1990,7 @@ replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_valu // replace_if template <class _ForwardIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) { @@ -2070,7 +2002,7 @@ replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, // replace_copy template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __old_value, const _Tp& __new_value) @@ -2086,7 +2018,7 @@ replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __re // replace_copy_if template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred, const _Tp& __new_value) @@ -2102,7 +2034,7 @@ replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator _ // fill_n template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) { @@ -2111,24 +2043,8 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) return __first; } -template <class _Tp, class _Size, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_integral<_Tp>::value && sizeof(_Tp) == 1 && - !is_same<_Tp, bool>::value && - is_integral<_Up>::value && sizeof(_Up) == 1, - _Tp* ->::type -__fill_n(_Tp* __first, _Size __n,_Up __value_) -{ - if (__n > 0) - _VSTD::memset(__first, (unsigned char)__value_, (size_t)(__n)); - return __first + __n; -} - template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) { @@ -2138,7 +2054,7 @@ fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) // fill template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag) { @@ -2147,7 +2063,7 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, f } template <class _RandomAccessIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag) { @@ -2155,7 +2071,7 @@ __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& _ } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -2165,7 +2081,7 @@ fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) // generate template <class _ForwardIterator, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) { @@ -2176,7 +2092,7 @@ generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) // generate_n template <class _OutputIterator, class _Size, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) { @@ -2190,7 +2106,7 @@ generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) // remove template <class _ForwardIterator, class _Tp> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { __first = _VSTD::find(__first, __last, __value_); @@ -2212,7 +2128,7 @@ remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) // remove_if template <class _ForwardIterator, class _Predicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type> @@ -2235,7 +2151,7 @@ remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) // remove_copy template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_) { @@ -2253,7 +2169,7 @@ remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res // remove_copy_if template <class _InputIterator, class _OutputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) { @@ -2271,7 +2187,7 @@ remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __ // unique template <class _ForwardIterator, class _BinaryPredicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type> @@ -2290,7 +2206,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pre } template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator unique(_ForwardIterator __first, _ForwardIterator __last) { @@ -2301,7 +2217,7 @@ unique(_ForwardIterator __first, _ForwardIterator __last) // unique_copy template <class _BinaryPredicate, class _InputIterator, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred, input_iterator_tag, output_iterator_tag) { @@ -2324,7 +2240,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __r } template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred, forward_iterator_tag, output_iterator_tag) { @@ -2347,7 +2263,7 @@ __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator } template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred, input_iterator_tag, forward_iterator_tag) { @@ -2363,7 +2279,7 @@ __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __ } template <class _InputIterator, class _OutputIterator, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) { @@ -2374,7 +2290,7 @@ unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __res } template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -2419,7 +2335,7 @@ reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) // reverse_copy template <class _BidirectionalIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { @@ -3303,7 +3219,7 @@ template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> } template <class _InputIterator, class _Predicate> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) @@ -3381,7 +3297,7 @@ partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) template <class _InputIterator, class _OutputIterator1, class _OutputIterator2, class _Predicate> -pair<_OutputIterator1, _OutputIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> partition_copy(_InputIterator __first, _InputIterator __last, _OutputIterator1 __out_true, _OutputIterator2 __out_false, _Predicate __pred) @@ -3405,7 +3321,7 @@ partition_copy(_InputIterator __first, _InputIterator __last, // partition_point template<class _ForwardIterator, class _Predicate> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; @@ -3711,7 +3627,7 @@ stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate _ // is_sorted_until template <class _ForwardIterator, class _Compare> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { if (__first != __last) @@ -3728,7 +3644,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __co } template<class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) { @@ -3738,7 +3654,7 @@ is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) // is_sorted template <class _ForwardIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { @@ -3746,7 +3662,7 @@ is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) } template<class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_sorted(_ForwardIterator __first, _ForwardIterator __last) { @@ -4272,7 +4188,7 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, // lower_bound template <class _Compare, class _ForwardIterator, class _Tp> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; @@ -4294,7 +4210,7 @@ __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4309,7 +4225,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4320,7 +4236,7 @@ lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // upper_bound template <class _Compare, class _ForwardIterator, class _Tp> -_ForwardIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; @@ -4342,7 +4258,7 @@ __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4357,7 +4273,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4368,7 +4284,7 @@ upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // equal_range template <class _Compare, class _ForwardIterator, class _Tp> -pair<_ForwardIterator, _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; @@ -4402,7 +4318,7 @@ __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4417,7 +4333,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4428,7 +4344,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu // binary_search template <class _Compare, class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4437,7 +4353,7 @@ __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __ } template <class _ForwardIterator, class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) { @@ -4452,7 +4368,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va } template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) { @@ -4787,9 +4703,9 @@ __stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1 ::new(__first2) value_type(_VSTD::move(*__first1)); return; case 2: - __destruct_n __d(0); + __destruct_n __d(0); unique_ptr<value_type, __destruct_n&> __h2(__first2, __d); - if (__comp(*--__last1, *__first1)) + if (__comp(*--__last1, *__first1)) { ::new(__first2) value_type(_VSTD::move(*__last1)); __d.__incr((value_type*)0); @@ -4906,7 +4822,7 @@ stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) // is_heap_until template <class _RandomAccessIterator, class _Compare> -_RandomAccessIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type; @@ -4933,7 +4849,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp } template<class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) { @@ -4943,7 +4859,7 @@ is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) // is_heap template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { @@ -4951,7 +4867,7 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __ } template<class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) { @@ -5489,7 +5405,7 @@ nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomA // includes template <class _Compare, class _InputIterator1, class _InputIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { @@ -5504,7 +5420,7 @@ __includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __ } template <class _InputIterator1, class _InputIterator2, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) @@ -5520,7 +5436,7 @@ includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __fi } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { @@ -5586,7 +5502,7 @@ set_union(_InputIterator1 __first1, _InputIterator1 __last1, // set_intersection template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_OutputIterator +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) { @@ -5609,7 +5525,7 @@ __set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) @@ -5625,7 +5541,7 @@ set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) @@ -5751,7 +5667,7 @@ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, // lexicographical_compare template <class _Compare, class _InputIterator1, class _InputIterator2> -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { @@ -5766,7 +5682,7 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) @@ -5782,7 +5698,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template <class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) |