This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] Define __cpp_lib_erase_if feature test macro


On 10/01/19 13:49 +0000, Jonathan Wakely wrote:
The C++2a draft specifies the value 201811L for this, but as an
extension we return the number of elements erased. This is expected to
be standardised, so the macro has the value 201900L until a proper value
is specified in the draft.

	* include/bits/erase_if.h: Define __cpp_lib_erase_if.
	* include/std/deque: Likewise.
	* include/std/forward_list: Likewise.
	* include/std/list: Likewise.
	* include/std/string: Likewise.
	* include/std/vector: Likewise.
	* include/std/version: Likewise.
	* testsuite/21_strings/basic_string/erasure.cc: Test macro.
	* testsuite/23_containers/deque/erasure.cc: Likewise.
	* testsuite/23_containers/forward_list/erasure.cc: Likewise.
	* testsuite/23_containers/list/erasure.cc: Likewise.
	* testsuite/23_containers/map/erasure.cc: Likewise.
	* testsuite/23_containers/set/erasure.cc: Likewise.
	* testsuite/23_containers/unordered_map/erasure.cc: Likewise.
	* testsuite/23_containers/unordered_set/erasure.cc: Likewise.
	* testsuite/23_containers/vector/erasure.cc: Likewise.

Tested x86_64-linux, committed to trunk.




diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index f090fba0308..e11ae3a688a 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -96,6 +96,7 @@
#define __cpp_lib_clamp 201603
#define __cpp_lib_constexpr_char_traits 201611
#define __cpp_lib_enable_shared_from_this 201603
+#define __cpp_lib_erase_if 201900L
#define __cpp_lib_filesystem 201703
#define __cpp_lib_gcd 201606
#define __cpp_lib_gcd_lcm 201606

I put this in the C++17 group, but it's a C++2a feature.

Fixed with this patch, committed to trunk.


commit e60c82dfba1812b17d427382239cec4d7341bc75
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jan 11 22:29:21 2019 +0000

    Fix location of __cpp_lib_erase_if macro
    
    This macro should only be defined for C++2a, not C++17.
    
            * include/std/version (__cpp_lib_erase_if): Move to C++20 group.

diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index 903b75b483a..e9a1f1251af 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -96,7 +96,6 @@
 #define __cpp_lib_clamp 201603
 #define __cpp_lib_constexpr_char_traits 201611
 #define __cpp_lib_enable_shared_from_this 201603
-#define __cpp_lib_erase_if 201900L
 #define __cpp_lib_filesystem 201703
 #define __cpp_lib_gcd 201606
 #define __cpp_lib_gcd_lcm 201606
@@ -142,6 +141,7 @@
 
 #if __cplusplus > 201703L
 // c++2a
+#define __cpp_lib_erase_if 201900L
 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
 # define __cpp_lib_is_constant_evaluated 201811L
 #endif

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