Commit 538a7cd0 by François Dumont

stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.

2018-05-27  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.
	(_Rb_tree(const allocator_type&)): Use latter.
	* include/bits/stl_map.h (map(const allocator_type&)): Likewise.
	(map(initializer_list<value_type>, const allocator_type&)): Likewise.
	(map(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
	* include/bits/stl_multimap.h
	(multimap(const allocator_type&)): Likewise.
	(multimap(initializer_list<value_type>, const allocator_type&)):
	Likewise.
	(multimap(_InputIterator, _InputIterator, const allocator_type&)):
	Likewise.
	* include/bits/stl_set.h (set(const allocator_type&)): Likewise.
	(set(initializer_list<value_type>, const allocator_type&)): Likewise.
	(set(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
	* include/bits/stl_multiset.h
	(multiset(const allocator_type&)): Likewise.
	(multiset(initializer_list<value_type>, const allocator_type&)):
	Likewise.
	(multiset(_InputIterator, _InputIterator, const allocator_type&)):
	Likewise.

From-SVN: r260806
parent 8889fbe5
2018-05-27 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New.
(_Rb_tree(const allocator_type&)): Use latter.
* include/bits/stl_map.h (map(const allocator_type&)): Likewise.
(map(initializer_list<value_type>, const allocator_type&)): Likewise.
(map(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
* include/bits/stl_multimap.h
(multimap(const allocator_type&)): Likewise.
(multimap(initializer_list<value_type>, const allocator_type&)):
Likewise.
(multimap(_InputIterator, _InputIterator, const allocator_type&)):
Likewise.
* include/bits/stl_set.h (set(const allocator_type&)): Likewise.
(set(initializer_list<value_type>, const allocator_type&)): Likewise.
(set(_InputIterator, _InputIterator, const allocator_type&)): Likewise.
* include/bits/stl_multiset.h
(multiset(const allocator_type&)): Likewise.
(multiset(initializer_list<value_type>, const allocator_type&)):
Likewise.
(multiset(_InputIterator, _InputIterator, const allocator_type&)):
Likewise.
2018-05-25 François Dumont <fdumont@gcc.gnu.org> 2018-05-25 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/85768 PR libstdc++/85768
......
...@@ -232,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -232,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended default constructor. /// Allocator-extended default constructor.
explicit explicit
map(const allocator_type& __a) map(const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) { } : _M_t(_Pair_alloc_type(__a)) { }
/// Allocator-extended copy constructor. /// Allocator-extended copy constructor.
map(const map& __m, const allocator_type& __a) map(const map& __m, const allocator_type& __a)
...@@ -246,14 +246,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -246,14 +246,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended initialier-list constructor. /// Allocator-extended initialier-list constructor.
map(initializer_list<value_type> __l, const allocator_type& __a) map(initializer_list<value_type> __l, const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) : _M_t(_Pair_alloc_type(__a))
{ _M_t._M_insert_unique(__l.begin(), __l.end()); } { _M_t._M_insert_unique(__l.begin(), __l.end()); }
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
map(_InputIterator __first, _InputIterator __last, map(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) : _M_t(_Pair_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); } { _M_t._M_insert_unique(__first, __last); }
#endif #endif
......
...@@ -229,7 +229,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -229,7 +229,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended default constructor. /// Allocator-extended default constructor.
explicit explicit
multimap(const allocator_type& __a) multimap(const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) { } : _M_t(_Pair_alloc_type(__a)) { }
/// Allocator-extended copy constructor. /// Allocator-extended copy constructor.
multimap(const multimap& __m, const allocator_type& __a) multimap(const multimap& __m, const allocator_type& __a)
...@@ -243,14 +243,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -243,14 +243,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended initialier-list constructor. /// Allocator-extended initialier-list constructor.
multimap(initializer_list<value_type> __l, const allocator_type& __a) multimap(initializer_list<value_type> __l, const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) : _M_t(_Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__l.begin(), __l.end()); } { _M_t._M_insert_equal(__l.begin(), __l.end()); }
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last, multimap(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Pair_alloc_type(__a)) : _M_t(_Pair_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
#endif #endif
......
...@@ -245,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -245,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended default constructor. /// Allocator-extended default constructor.
explicit explicit
multiset(const allocator_type& __a) multiset(const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) { } : _M_t(_Key_alloc_type(__a)) { }
/// Allocator-extended copy constructor. /// Allocator-extended copy constructor.
multiset(const multiset& __m, const allocator_type& __a) multiset(const multiset& __m, const allocator_type& __a)
...@@ -259,14 +259,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -259,14 +259,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended initialier-list constructor. /// Allocator-extended initialier-list constructor.
multiset(initializer_list<value_type> __l, const allocator_type& __a) multiset(initializer_list<value_type> __l, const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_equal(__l.begin(), __l.end()); } { _M_t._M_insert_equal(__l.begin(), __l.end()); }
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
multiset(_InputIterator __first, _InputIterator __last, multiset(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_equal(__first, __last); } { _M_t._M_insert_equal(__first, __last); }
/** /**
......
...@@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended default constructor. /// Allocator-extended default constructor.
explicit explicit
set(const allocator_type& __a) set(const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) { } : _M_t(_Key_alloc_type(__a)) { }
/// Allocator-extended copy constructor. /// Allocator-extended copy constructor.
set(const set& __x, const allocator_type& __a) set(const set& __x, const allocator_type& __a)
...@@ -263,14 +263,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -263,14 +263,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Allocator-extended initialier-list constructor. /// Allocator-extended initialier-list constructor.
set(initializer_list<value_type> __l, const allocator_type& __a) set(initializer_list<value_type> __l, const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_unique(__l.begin(), __l.end()); } { _M_t._M_insert_unique(__l.begin(), __l.end()); }
/// Allocator-extended range constructor. /// Allocator-extended range constructor.
template<typename _InputIterator> template<typename _InputIterator>
set(_InputIterator __first, _InputIterator __last, set(_InputIterator __first, _InputIterator __last,
const allocator_type& __a) const allocator_type& __a)
: _M_t(_Compare(), _Key_alloc_type(__a)) : _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_unique(__first, __last); } { _M_t._M_insert_unique(__first, __last); }
/** /**
......
...@@ -715,6 +715,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -715,6 +715,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#else #else
_Rb_tree_impl(_Rb_tree_impl&&) = default; _Rb_tree_impl(_Rb_tree_impl&&) = default;
explicit
_Rb_tree_impl(_Node_allocator&& __a)
: _Node_allocator(std::move(__a))
{ }
_Rb_tree_impl(_Rb_tree_impl&& __x, _Node_allocator&& __a) _Rb_tree_impl(_Rb_tree_impl&& __x, _Node_allocator&& __a)
: _Node_allocator(std::move(__a)), : _Node_allocator(std::move(__a)),
_Base_key_compare(std::move(__x)), _Base_key_compare(std::move(__x)),
...@@ -948,7 +953,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -948,7 +953,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
_Rb_tree(const allocator_type& __a) _Rb_tree(const allocator_type& __a)
: _M_impl(_Compare(), _Node_allocator(__a)) : _M_impl(_Node_allocator(__a))
{ } { }
_Rb_tree(const _Rb_tree& __x, const allocator_type& __a) _Rb_tree(const _Rb_tree& __x, const allocator_type& __a)
......
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