aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-01-10 13:49:31 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-01-10 13:49:31 +0000
commit45a8d80fec060195ef6936e43b4fe70158fb7dc7 (patch)
treec333d521f63704c543b005569ff9cb46ef8cbc5f /libstdc++-v3/include/std
parentcbe0bca4040e592889f022be23f9602a24487985 (diff)
downloadgcc-45a8d80fec060195ef6936e43b4fe70158fb7dc7.zip
gcc-45a8d80fec060195ef6936e43b4fe70158fb7dc7.tar.gz
gcc-45a8d80fec060195ef6936e43b4fe70158fb7dc7.tar.bz2
Define __cpp_lib_erase_if feature test macro
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. From-SVN: r267810
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r--libstdc++-v3/include/std/deque3
-rw-r--r--libstdc++-v3/include/std/forward_list3
-rw-r--r--libstdc++-v3/include/std/list3
-rw-r--r--libstdc++-v3/include/std/string3
-rw-r--r--libstdc++-v3/include/std/vector3
-rw-r--r--libstdc++-v3/include/std/version1
6 files changed, 16 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index 7932b1c..ed4927e 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -94,6 +94,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define __cpp_lib_erase_if 201900L
+
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename deque<_Tp, _Alloc>::size_type
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
diff --git a/libstdc++-v3/include/std/forward_list b/libstdc++-v3/include/std/forward_list
index 93c9590..3d3b6d4 100644
--- a/libstdc++-v3/include/std/forward_list
+++ b/libstdc++-v3/include/std/forward_list
@@ -65,6 +65,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define __cpp_lib_erase_if 201900L
+
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename forward_list<_Tp, _Alloc>::size_type
erase_if(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred)
diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list
index 5ea9a96..7b02e86 100644
--- a/libstdc++-v3/include/std/list
+++ b/libstdc++-v3/include/std/list
@@ -89,6 +89,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define __cpp_lib_erase_if 201900L
+
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename list<_Tp, _Alloc>::size_type
erase_if(list<_Tp, _Alloc>& __cont, _Predicate __pred)
diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string
index dc718b8..caa54c2 100644
--- a/libstdc++-v3/include/std/string
+++ b/libstdc++-v3/include/std/string
@@ -79,6 +79,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define __cpp_lib_erase_if 201900L
+
template<typename _CharT, typename _Traits, typename _Alloc,
typename _Predicate>
inline typename basic_string<_CharT, _Traits, _Alloc>::size_type
diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector
index 0594518..2c90765 100644
--- a/libstdc++-v3/include/std/vector
+++ b/libstdc++-v3/include/std/vector
@@ -97,6 +97,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+#define __cpp_lib_erase_if 201900L
+
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename vector<_Tp, _Alloc>::size_type
erase_if(vector<_Tp, _Alloc>& __cont, _Predicate __pred)
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index f090fba..e11ae3a 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