Commit ea365e01 by Edward Smith-Rowland Committed by Edward Smith-Rowland

Inline one-line erasure dispatch functions.

2015-05-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Inline one-line erasure dispatch functions.
	* include/experimental/forward_list (erase_if(), erase()): Inline.
	* include/experimental/list (erase_if(), erase()): Inline.
	* include/experimental/map (erase_if(*)): Inline.
	* include/experimental/set (erase_if(*)): Inline.
	* include/experimental/string (erase_if(), erase()): Inline.
	* include/experimental/unordered_map (erase_if(*)): Inline.
	* include/experimental/unordered_set (erase_if(*)): Inline.

From-SVN: r222684
parent fdae5092
2015-05-01 Edward Smith-Rowland <3dw4rd@verizon.net>
Inline one-line erasure dispatch functions.
* include/experimental/forward_list (erase_if(), erase()): Inline.
* include/experimental/list (erase_if(), erase()): Inline.
* include/experimental/map (erase_if(*)): Inline.
* include/experimental/set (erase_if(*)): Inline.
* include/experimental/string (erase_if(), erase()): Inline.
* include/experimental/unordered_map (erase_if(*)): Inline.
* include/experimental/unordered_set (erase_if(*)): Inline.
2015-05-01 Jonathan Wakely <jwakely@redhat.com> 2015-05-01 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/intro.xml: Link to new status_cxx2017.xml file. * doc/xml/manual/intro.xml: Link to new status_cxx2017.xml file.
......
...@@ -46,12 +46,13 @@ inline namespace fundamentals_v2 ...@@ -46,12 +46,13 @@ inline namespace fundamentals_v2
_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(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred) erase_if(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred)
{ __cont.remove_if(__pred); } { __cont.remove_if(__pred); }
template<typename _Tp, typename _Alloc, typename _Up> template<typename _Tp, typename _Alloc, typename _Up>
void erase(forward_list<_Tp, _Alloc>& __cont, const _Up& __value) inline void
erase(forward_list<_Tp, _Alloc>& __cont, const _Up& __value)
{ {
using __elem_type = typename forward_list<_Tp, _Alloc>::value_type; using __elem_type = typename forward_list<_Tp, _Alloc>::value_type;
erase_if(__cont, [&](__elem_type& __elem) { return __elem == __value; }); erase_if(__cont, [&](__elem_type& __elem) { return __elem == __value; });
......
...@@ -46,12 +46,12 @@ inline namespace fundamentals_v2 ...@@ -46,12 +46,12 @@ inline namespace fundamentals_v2
_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(list<_Tp, _Alloc>& __cont, _Predicate __pred) erase_if(list<_Tp, _Alloc>& __cont, _Predicate __pred)
{ __cont.remove_if(__pred); } { __cont.remove_if(__pred); }
template<typename _Tp, typename _Alloc, typename _Up> template<typename _Tp, typename _Alloc, typename _Up>
void inline void
erase(list<_Tp, _Alloc>& __cont, const _Up& __value) erase(list<_Tp, _Alloc>& __cont, const _Up& __value)
{ {
using __elem_type = typename list<_Tp, _Alloc>::value_type; using __elem_type = typename list<_Tp, _Alloc>::value_type;
......
...@@ -48,13 +48,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,13 +48,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc, template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(map<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred) erase_if(map<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc, template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(multimap<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred) erase_if(multimap<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
......
...@@ -48,13 +48,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,13 +48,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Key, typename _Compare, typename _Alloc, template<typename _Key, typename _Compare, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(set<_Key, _Compare, _Alloc>& __cont, _Predicate __pred) erase_if(set<_Key, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
template<typename _Key, typename _Compare, typename _Alloc, template<typename _Key, typename _Compare, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(multiset<_Key, _Compare, _Alloc>& __cont, _Predicate __pred) erase_if(multiset<_Key, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
......
...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _CharT, typename _Traits, typename _Alloc, template<typename _CharT, typename _Traits, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(basic_string<_CharT, _Traits, _Alloc>& __cont, _Predicate __pred) erase_if(basic_string<_CharT, _Traits, _Alloc>& __cont, _Predicate __pred)
{ {
__cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred), __cont.erase(std::remove_if(__cont.begin(), __cont.end(), __pred),
...@@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _CharT, typename _Traits, typename _Alloc, typename _Up> template<typename _CharT, typename _Traits, typename _Alloc, typename _Up>
void inline void
erase(basic_string<_CharT, _Traits, _Alloc>& __cont, const _Up& __value) erase(basic_string<_CharT, _Traits, _Alloc>& __cont, const _Up& __value)
{ {
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value), __cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
......
...@@ -48,14 +48,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,14 +48,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Key, typename _Tp, typename _Hash, typename _CPred, template<typename _Key, typename _Tp, typename _Hash, typename _CPred,
typename _Alloc, typename _Predicate> typename _Alloc, typename _Predicate>
void inline void
erase_if(unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, erase_if(unordered_map<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont,
_Predicate __pred) _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
template<typename _Key, typename _Tp, typename _Hash, typename _CPred, template<typename _Key, typename _Tp, typename _Hash, typename _CPred,
typename _Alloc, typename _Predicate> typename _Alloc, typename _Predicate>
void inline void
erase_if(unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont, erase_if(unordered_multimap<_Key, _Tp, _Hash, _CPred, _Alloc>& __cont,
_Predicate __pred) _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
......
...@@ -48,14 +48,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,14 +48,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Key, typename _Hash, typename _CPred, typename _Alloc, template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(unordered_set<_Key, _Hash, _CPred, _Alloc>& __cont, erase_if(unordered_set<_Key, _Hash, _CPred, _Alloc>& __cont,
_Predicate __pred) _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
template<typename _Key, typename _Hash, typename _CPred, typename _Alloc, template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
typename _Predicate> typename _Predicate>
void inline void
erase_if(unordered_multiset<_Key, _Hash, _CPred, _Alloc>& __cont, erase_if(unordered_multiset<_Key, _Hash, _CPred, _Alloc>& __cont,
_Predicate __pred) _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); } { __detail::__erase_nodes_if(__cont, __pred); }
......
...@@ -47,7 +47,7 @@ inline namespace fundamentals_v2 ...@@ -47,7 +47,7 @@ inline namespace fundamentals_v2
_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(vector<_Tp, _Alloc>& __cont, _Predicate __pred) erase_if(vector<_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),
...@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
template<typename _Tp, typename _Alloc, typename _Up> template<typename _Tp, typename _Alloc, typename _Up>
void inline void
erase(vector<_Tp, _Alloc>& __cont, const _Up& __value) erase(vector<_Tp, _Alloc>& __cont, const _Up& __value)
{ {
__cont.erase(std::remove(__cont.begin(), __cont.end(), __value), __cont.erase(std::remove(__cont.begin(), __cont.end(), __value),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment