aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Smith-Rowland <emsr@gcc.gnu.org>2018-11-30 16:13:29 +0000
committerEdward Smith-Rowland <emsr@gcc.gnu.org>2018-11-30 16:13:29 +0000
commit32bbb362efbc5d0a9269c8f32258360c622121db (patch)
tree09a0d428bba9889356e74abd79fcdf3c49dc845f
parent0b44b4b807a2d7bee4d2a0e4c37794db2aeeb44f (diff)
downloadgcc-32bbb362efbc5d0a9269c8f32258360c622121db.zip
gcc-32bbb362efbc5d0a9269c8f32258360c622121db.tar.gz
gcc-32bbb362efbc5d0a9269c8f32258360c622121db.tar.bz2
The remainder of the Pre-emptively support P0646R1 for std container erasure.
From-SVN: r266673
-rw-r--r--libstdc++-v3/include/std/deque8
1 files changed, 6 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index 25de200..23dc752 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -95,19 +95,23 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Alloc, typename _Predicate>
- inline void
+ inline typename deque<_Tp, _Alloc>::size_type
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
{
+ const auto __osz = __cont.size();
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
__cont.end());
+ return __osz - __cont.size();
}
template<typename _Tp, typename _Alloc, typename _Up>
- inline void
+ inline typename deque<_Tp, _Alloc>::size_type
erase(deque<_Tp, _Alloc>& __cont, const _Up& __value)
{
+ const auto __osz = __cont.size();
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
__cont.end());
+ return __osz - __cont.size();
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std