[PATCH] Define __cpp_lib_erase_if feature test macro

Jonathan Wakely jwakely@redhat.com
Fri Jan 11 23:41:00 GMT 2019


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190111/517889c9/attachment.bin>


More information about the Libstdc++ mailing list