diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque index 25de200cefd..23dc752c4b2 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 - 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 - 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