From: Arthur O'Dwyer Date: Thu, 3 Dec 2020 01:02:18 +0000 (-0500) Subject: [libc++] Update the commented "synopsis" in to match current reality. X-Git-Tag: llvmorg-13-init~4314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8bc4e153f01002a52ce628ef53486c4396863b3;p=platform%2Fupstream%2Fllvm.git [libc++] Update the commented "synopsis" in to match current reality. The synopsis now reflects what's implemented. It does NOT reflect all of what's specified in C++20. The "constexpr in C++20" markings are still missing from these 12 algorithms, because they are still unimplemented by libc++: reverse partition sort nth_element next_permutation prev_permutation push_heap pop_heap make_heap sort_heap partial_sort partial_sort_copy All of the above algorithms were excluded from [P0202]. All of the above algorithms were made constexpr in [P0879] (along with swap_ranges, iter_swap, and rotate — we've already implemented those three). Differential Revision: https://reviews.llvm.org/D92255 --- diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 7ad8ff9..3bb6c78 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -47,16 +47,16 @@ template find_if(InputIterator first, InputIterator last, Predicate pred); template - InputIterator // constexpr in C++20 + constexpr InputIterator // constexpr in C++20 find_if_not(InputIterator first, InputIterator last, Predicate pred); template - ForwardIterator1 // constexpr in C++20 + constexpr ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template - ForwardIterator1 // constexpr in C++20 + constexpr ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); @@ -185,11 +185,11 @@ template BidirectionalIterator2 result); template - ForwardIterator2 + constexpr ForwardIterator2 // constexpr in C++20 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); template - void + constexpr void // constexpr in C++20 iter_swap(ForwardIterator1 a, ForwardIterator2 b); template @@ -251,19 +251,19 @@ template remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); template - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 unique(ForwardIterator first, ForwardIterator last); template - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); template - OutputIterator + constexpr OutputIterator // constexpr in C++20 unique_copy(InputIterator first, InputIterator last, OutputIterator result); template - OutputIterator + constexpr OutputIterator // constexpr in C++20 unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); template @@ -275,11 +275,11 @@ template reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); template - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); template - OutputIterator + constexpr OutputIterator // constexpr in C++20 rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); template @@ -329,7 +329,7 @@ template is_sorted(ForwardIterator first, ForwardIterator last); template - bool + constexpr bool // constexpr in C++20 is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); template @@ -529,82 +529,82 @@ template is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template - ForwardIterator - min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + min_element(ForwardIterator first, ForwardIterator last); template - ForwardIterator - min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + min_element(ForwardIterator first, ForwardIterator last, Compare comp); template - const T& - min(const T& a, const T& b); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + min(const T& a, const T& b); template - const T& - min(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + min(const T& a, const T& b, Compare comp); template - T - min(initializer_list t); // constexpr in C++14 + constexpr T // constexpr in C++14 + min(initializer_list t); template - T - min(initializer_list t, Compare comp); // constexpr in C++14 + constexpr T // constexpr in C++14 + min(initializer_list t, Compare comp); template - constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17 + constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 template - constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17 + constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 template - ForwardIterator - max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + max_element(ForwardIterator first, ForwardIterator last); template - ForwardIterator - max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + max_element(ForwardIterator first, ForwardIterator last, Compare comp); template - const T& - max(const T& a, const T& b); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + max(const T& a, const T& b); template - const T& - max(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + max(const T& a, const T& b, Compare comp); template - T - max(initializer_list t); // constexpr in C++14 + constexpr T // constexpr in C++14 + max(initializer_list t); template - T - max(initializer_list t, Compare comp); // constexpr in C++14 + constexpr T // constexpr in C++14 + max(initializer_list t, Compare comp); template - pair - minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax_element(ForwardIterator first, ForwardIterator last); template - pair - minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); template - pair - minmax(const T& a, const T& b); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax(const T& a, const T& b); template - pair - minmax(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax(const T& a, const T& b, Compare comp); template - pair - minmax(initializer_list t); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax(initializer_list t); template - pair - minmax(initializer_list t, Compare comp); // constexpr in C++14 + constexpr pair // constexpr in C++14 + minmax(initializer_list t, Compare comp); template constexpr bool // constexpr in C++20