Implement C++20 p0879 - Constexpr for swap and swap related functions.
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Wed, 14 Aug 2019 17:54:15 +0000 (17:54 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Wed, 14 Aug 2019 17:54:15 +0000 (17:54 +0000)
commit7a91c710999d274c188fc0c504732a6f0b9059c1
tree524bc4d35333f8ba97b84400a1f5908d8d51c4d3
parent0bdf9f92531932ff1bb238ed84bf90597d9be3d2
Implement C++20 p0879 - Constexpr for swap and swap related functions.

2019-08-14  Edward Smith-Rowland  <3dw4rd@verizon.net>

Implement C++20 p0879 - Constexpr for swap and swap related functions.
* include/std/version (__cpp_lib_constexpr_swap_algorithms): New macro.
* include/bits/algorithmfwd.h (__cpp_lib_constexpr_swap_algorithms):
New macro.
(iter_swap, make_heap, next_permutation, partial_sort_copy, pop_heap)
(prev_permutation, push_heap, reverse, rotate, sort_heap, swap)
(swap_ranges, nth_element, partial_sort, sort): Add constexpr.
* include/bits/move.h (swap): Add constexpr.
* include/bits/stl_algo.h (__move_median_to_first, __reverse, reverse)
(__gcd, __rotate, rotate, __partition, __heap_select)
(__partial_sort_copy, partial_sort_copy, __unguarded_partition)
(__unguarded_partition_pivot, __partial_sort, __introsort_loop, __sort)
(__introselect, __chunk_insertion_sort, next_permutation)
(prev_permutation, partition, partial_sort, nth_element, sort)
(__iter_swap::iter_swap, iter_swap, swap_ranges): Add constexpr.
* include/bits/stl_algobase.h (__iter_swap::iter_swap, iter_swap)
(swap_ranges): Add constexpr.
* include/bits/stl_heap.h (__push_heap, push_heap, __adjust_heap,
__pop_heap, pop_heap, __make_heap, make_heap, __sort_heap, sort_heap):
Add constexpr.
* include/std/type_traits (swap): Add constexpr.
* testsuite/25_algorithms/headers/algorithm/synopsis.cc: Add constexpr.
* testsuite/25_algorithms/iter_swap/constexpr.cc: New test.
* testsuite/25_algorithms/make_heap/constexpr.cc: New test.
* testsuite/25_algorithms/next_permutation/constexpr.cc: New test.
* testsuite/25_algorithms/nth_element/constexpr.cc: New test.
* testsuite/25_algorithms/partial_sort/constexpr.cc: New test.
* testsuite/25_algorithms/partial_sort_copy/constexpr.cc: New test.
* testsuite/25_algorithms/partition/constexpr.cc: New test.
* testsuite/25_algorithms/pop_heap/constexpr.cc: New test.
* testsuite/25_algorithms/prev_permutation/constexpr.cc: New test.
* testsuite/25_algorithms/push_heap/constexpr.cc: New test.
* testsuite/25_algorithms/reverse/constexpr.cc: New test.
* testsuite/25_algorithms/rotate/constexpr.cc: New test.
* testsuite/25_algorithms/sort/constexpr.cc: New test.
* testsuite/25_algorithms/sort_heap/constexpr.cc: New test.
* testsuite/25_algorithms/swap/constexpr.cc: New test.
* testsuite/25_algorithms/swap_ranges/constexpr.cc: New test.

From-SVN: r274488
25 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/move.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_heap.h
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc
libstdc++-v3/testsuite/25_algorithms/iter_swap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/make_heap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/next_permutation/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/nth_element/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/partial_sort/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/partition/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/pop_heap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/prev_permutation/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/push_heap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/reverse/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/rotate/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/sort/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/sort_heap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/swap/constexpr.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/swap_ranges/constexpr.cc [new file with mode: 0644]