Fix erasure goofs.
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. From-SVN: r266616
This commit is contained in:
parent
154fb72b6d
commit
a62b871d65
|
@ -1,3 +1,23 @@
|
||||||
|
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>
|
2018-11-29 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/88119
|
PR libstdc++/88119
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace experimental
|
||||||
inline namespace fundamentals_v2
|
inline namespace fundamentals_v2
|
||||||
{
|
{
|
||||||
template<typename _Tp, typename _Alloc, typename _Predicate>
|
template<typename _Tp, typename _Alloc, typename _Predicate>
|
||||||
void
|
inline void
|
||||||
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
|
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
|
||||||
{
|
{
|
||||||
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
|
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
|
||||||
|
@ -54,7 +54,7 @@ inline namespace fundamentals_v2
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Tp, typename _Alloc, typename _Up>
|
template<typename _Tp, typename _Alloc, typename _Up>
|
||||||
void
|
inline void
|
||||||
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
|
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
|
||||||
{
|
{
|
||||||
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
|
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#include <bits/stl_algobase.h>
|
#include <bits/stl_algobase.h>
|
||||||
|
#include <bits/stl_algo.h> // For remove and remove_if
|
||||||
#include <bits/allocator.h>
|
#include <bits/allocator.h>
|
||||||
#include <bits/stl_construct.h>
|
#include <bits/stl_construct.h>
|
||||||
#include <bits/stl_uninitialized.h>
|
#include <bits/stl_uninitialized.h>
|
||||||
|
@ -92,7 +93,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
|
||||||
{
|
{
|
||||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
template<typename _Tp, typename _Alloc, typename _Predicate>
|
template<typename _Tp, typename _Alloc, typename _Predicate>
|
||||||
void
|
inline void
|
||||||
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
|
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
|
||||||
{
|
{
|
||||||
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
|
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
|
||||||
|
@ -100,7 +101,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Tp, typename _Alloc, typename _Up>
|
template<typename _Tp, typename _Alloc, typename _Up>
|
||||||
void
|
inline void
|
||||||
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
|
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
|
||||||
{
|
{
|
||||||
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
|
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
|
||||||
|
|
|
@ -48,10 +48,10 @@
|
||||||
#include <bits/stl_function.h> // For less
|
#include <bits/stl_function.h> // For less
|
||||||
#include <ext/numeric_traits.h>
|
#include <ext/numeric_traits.h>
|
||||||
#include <bits/stl_algobase.h>
|
#include <bits/stl_algobase.h>
|
||||||
|
#include <bits/stl_algo.h> // For remove and remove_if
|
||||||
#include <bits/range_access.h>
|
#include <bits/range_access.h>
|
||||||
#include <bits/basic_string.h>
|
#include <bits/basic_string.h>
|
||||||
#include <bits/basic_string.tcc>
|
#include <bits/basic_string.tcc>
|
||||||
#include <algorithm> // For remove and remove_if
|
|
||||||
|
|
||||||
#if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
|
#if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
|
||||||
namespace std _GLIBCXX_VISIBILITY(default)
|
namespace std _GLIBCXX_VISIBILITY(default)
|
||||||
|
|
|
@ -82,6 +82,19 @@ _GLIBCXX_END_NAMESPACE_VERSION
|
||||||
namespace std _GLIBCXX_VISIBILITY(default)
|
namespace std _GLIBCXX_VISIBILITY(default)
|
||||||
{
|
{
|
||||||
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
_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
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
} // namespace std
|
} // namespace std
|
||||||
#endif // C++20
|
#endif // C++20
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
|
|
||||||
#include <bits/stl_algobase.h>
|
#include <bits/stl_algobase.h>
|
||||||
|
#include <bits/stl_algo.h> // For remove and remove_if
|
||||||
#include <bits/allocator.h>
|
#include <bits/allocator.h>
|
||||||
#include <bits/stl_construct.h>
|
#include <bits/stl_construct.h>
|
||||||
#include <bits/stl_uninitialized.h>
|
#include <bits/stl_uninitialized.h>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// { dg-options "-std=gnu++2a" }
|
||||||
// { dg-do run { target c++2a } }
|
// { dg-do run { target c++2a } }
|
||||||
|
|
||||||
// Copyright (C) 2018 Free Software Foundation, Inc.
|
// Copyright (C) 2018 Free Software Foundation, Inc.
|
||||||
|
|
Loading…
Reference in New Issue