This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] C++20 constexpr lib part 2/3 - swappish functions.


On 8/13/19 7:14 AM, Jonathan Wakely wrote:
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?
Indeed.

The new macro also needs to be added to <version>.

Done.

I this OK after it passes testing?

Ed



Attachment: CL_constexpr_swap
Description: Text document

Attachment: patch_constexpr_swap
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]