From 1b9a4ffd6bb2622360e6bae10bbcce7348186e94 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 22 Jan 2018 20:44:33 +0000 Subject: Still more P0202 constexpr-ifying. This batch is: for_each/for_each_n/lexicographical_compare llvm-svn: 323147 --- libcxx/include/algorithm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'libcxx/include/algorithm') diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index b750616f0e8..c00845f6404 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -32,11 +32,12 @@ template none_of(InputIterator first, InputIterator last, Predicate pred); template - Function + constexpr Function // constexpr in C++20 for_each(InputIterator first, InputIterator last, Function f); template - 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 constexpr InputIterator // constexpr in C++20 @@ -311,7 +312,7 @@ template template - pair + constexpr pair // constexpr in C++20 partition_copy(InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); @@ -607,11 +608,11 @@ template minmax(initializer_list t, Compare comp); // constexpr in C++14 template - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); template - bool + constexpr bool // constexpr in C++20 lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); @@ -958,7 +959,7 @@ none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) // for_each template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first, _InputIterator __last, _Function __f) { @@ -971,7 +972,7 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f) // for_each_n template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) { @@ -3288,7 +3289,7 @@ partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) template -pair<_OutputIterator1, _OutputIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> partition_copy(_InputIterator __first, _InputIterator __last, _OutputIterator1 __out_true, _OutputIterator2 __out_false, _Predicate __pred) @@ -5658,7 +5659,7 @@ set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, // lexicographical_compare template -bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { @@ -5673,7 +5674,7 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template -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) @@ -5689,7 +5690,7 @@ lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) -- cgit v1.2.3