30 #ifndef _GLIBCXX_ERASE_IF_H 31 #define _GLIBCXX_ERASE_IF_H 1 33 #ifdef _GLIBCXX_SYSHDR 34 #pragma GCC system_header 41 #if __cplusplus >= 201402L 44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
48 template<
typename _Container,
typename _UnsafeContainer,
51 typename _Container::size_type
52 __erase_if(_Container&
__cont, _UnsafeContainer& __ucont,
55 const auto __osz = __ucont.size();
56 const auto __end = __ucont.end();
57 auto __removed = std::__remove_if(__ucont.begin(), __end,
59 if (__removed != __end)
61 __cont.erase(__niter_wrap(__cont.begin(), __removed),
63 return __osz - __ucont.size();
69 template<
typename _Container,
typename _UnsafeContainer,
71 typename _Container::size_type
72 __erase_nodes_if(_Container& __cont, _UnsafeContainer& __ucont,
75 typename _Container::size_type __num = 0;
76 for (
auto __iter = __ucont.begin(), __last = __ucont.end();
81 __iter = __cont.erase(__iter);
91 _GLIBCXX_END_NAMESPACE_VERSION
95 #endif // _GLIBCXX_ERASE_IF_H ISO C++ entities toplevel namespace is std.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.