This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/3] C++20 constexpr lib part 2/3 - swappish functions.
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, Ville Voutilainen <ville dot voutilainen at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Aug 2019 12:14:52 +0100
- Subject: Re: [PATCH 2/3] C++20 constexpr lib part 2/3 - swappish functions.
- References: <ef0615ad-cfd0-4a54-2eb2-ed0804a3d027@verizon.net> <20190702121102.GL4665@redhat.com> <e509a674-05c4-b920-f471-ed3891ac6f90@verizon.net> <CAFk2RUaYxTus=YWNwam05NQ9JdYQ4W8+biPt-nfYep=e7kd9CA@mail.gmail.com> <7c8fcbb4-b39a-86bc-5d7e-9a15056a035a@verizon.net> <20190801105650.GO9487@redhat.com> <7b28c65f-744b-5201-90ca-3e0a02782c3a@verizon.net> <44a98bfa-bfba-9626-94eb-b3a7393f2ab2@verizon.net>
On 01/08/19 13:16 -0400, Ed Smith-Rowland via libstdc++ wrote:
Greetings,
Here is a patch for C++20 p0879 - Constexpr for swap and swap related
functions.
This essentially constexprifies the rest of <algorithm>.
Built and tested with C++20 (and pre-c++20) on x86_64-linux.
Ok?
Regards,
Ed Smith-Rowland
2019-08-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++20 p0879 - Constexpr for swap and swap related functions.
* include/bits/algorithmfwd.h (__cpp_lib_constexpr_swap_algorithms):
New macro. (iter_swap, make_heap, next_permutation, partial_sort_copy,
There should be a newline after "New macro." and before the next
parenthesized list of identifiers.
The parenthesized lists should not span multiple lines, so close and
reopen the parens, i.e.
Implement C++20 p0879 - Constexpr for swap and swap related functions.
* 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.
@@ -193,6 +193,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201703L
# define __cpp_lib_constexpr_algorithms 201711L
+# define __cpp_lib_constexpr_swap_algorithms 201712L
Should this value be 201806L?
The new macro also needs to be added to <version>.