+2018-11-29 Edward Smith-Rowland <3dw4rd@verizon.net>
+
+ Fix erasure goofs.
+ * include/experimental/deque: Make inline.
+ * include/std/deque: Include bits/stl_algo.h.
+ (erase, erase_if): Make inline.
+ * include/std/string: Include bits/stl_algo.h.
+ * include/std/unordered_set: Add erase, erase_if!
+ * include/std/vector: Include bits/stl_algo.h.
+ * testsuite/21_strings/basic_string/erasure.cc:
+ Add { dg-options "-std=gnu++2a" }.
+ * testsuite/23_containers/deque/erasure.cc: Ditto.
+ * testsuite/23_containers/forward_list/erasure.cc: Ditto.
+ * testsuite/23_containers/list/erasure.cc: Ditto.
+ * testsuite/23_containers/map/erasure.cc: Ditto.
+ * testsuite/23_containers/set/erasure.cc: Ditto.
+ * testsuite/23_containers/unordered_map/erasure.cc: Ditto.
+ * testsuite/23_containers/unordered_set/erasure.cc: Ditto.
+ * testsuite/23_containers/vector/erasure.cc: Ditto.
+
2018-11-29 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/88119
inline namespace fundamentals_v2
{
template<typename _Tp, typename _Alloc, typename _Predicate>
- void
+ inline void
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
{
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
}
template<typename _Tp, typename _Alloc, typename _Up>
- void
+ inline void
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
{
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
#pragma GCC system_header
#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Alloc, typename _Predicate>
- void
+ inline void
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
{
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
}
template<typename _Tp, typename _Alloc, typename _Up>
- void
+ inline void
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
{
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
#include <bits/stl_function.h> // For less
#include <ext/numeric_traits.h>
#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
#include <bits/range_access.h>
#include <bits/basic_string.h>
#include <bits/basic_string.tcc>
-#include <algorithm> // For remove and remove_if
#if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
namespace std _GLIBCXX_VISIBILITY(default)
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
+ typename _Predicate>
+ inline void
+ erase_if(unordered_set<_Key, _Hash, _CPred, _Alloc>& __cont,
+ _Predicate __pred)
+ { std::__detail::__erase_nodes_if(__cont, __pred); }
+
+ template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
+ typename _Predicate>
+ inline void
+ erase_if(unordered_multiset<_Key, _Hash, _CPred, _Alloc>& __cont,
+ _Predicate __pred)
+ { std::__detail::__erase_nodes_if(__cont, __pred); }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++20
#pragma GCC system_header
#include <bits/stl_algobase.h>
+#include <bits/stl_algo.h> // For remove and remove_if
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.
+// { dg-options "-std=gnu++2a" }
// { dg-do run { target c++2a } }
// Copyright (C) 2018 Free Software Foundation, Inc.