From 538a7cd055a77acd6301ece4d752da6288a36ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dumont?= Date: Sun, 27 May 2018 17:06:40 +0000 Subject: [PATCH] stl_tree.h (_Rb_tree_impl(_Node_allocator&&)): New. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2018-05-27 François Dumont * 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, const allocator_type&)): Likewise. (map(_InputIterator, _InputIterator, const allocator_type&)): Likewise. * include/bits/stl_multimap.h (multimap(const allocator_type&)): Likewise. (multimap(initializer_list, const allocator_type&)): Likewise. (multimap(_InputIterator, _InputIterator, const allocator_type&)): Likewise. * include/bits/stl_set.h (set(const allocator_type&)): Likewise. (set(initializer_list, const allocator_type&)): Likewise. (set(_InputIterator, _InputIterator, const allocator_type&)): Likewise. * include/bits/stl_multiset.h (multiset(const allocator_type&)): Likewise. (multiset(initializer_list, const allocator_type&)): Likewise. (multiset(_InputIterator, _InputIterator, const allocator_type&)): Likewise. From-SVN: r260806 --- libstdc++-v3/ChangeLog | 23 +++++++++++++++++++++++ libstdc++-v3/include/bits/stl_map.h | 6 +++--- libstdc++-v3/include/bits/stl_multimap.h | 6 +++--- libstdc++-v3/include/bits/stl_multiset.h | 6 +++--- libstdc++-v3/include/bits/stl_set.h | 6 +++--- libstdc++-v3/include/bits/stl_tree.h | 7 ++++++- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 02b8557bc25..3068a08b3ec 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,26 @@ +2018-05-27 François Dumont + + * 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, const allocator_type&)): Likewise. + (map(_InputIterator, _InputIterator, const allocator_type&)): Likewise. + * include/bits/stl_multimap.h + (multimap(const allocator_type&)): Likewise. + (multimap(initializer_list, const allocator_type&)): + Likewise. + (multimap(_InputIterator, _InputIterator, const allocator_type&)): + Likewise. + * include/bits/stl_set.h (set(const allocator_type&)): Likewise. + (set(initializer_list, const allocator_type&)): Likewise. + (set(_InputIterator, _InputIterator, const allocator_type&)): Likewise. + * include/bits/stl_multiset.h + (multiset(const allocator_type&)): Likewise. + (multiset(initializer_list, const allocator_type&)): + Likewise. + (multiset(_InputIterator, _InputIterator, const allocator_type&)): + Likewise. + 2018-05-25 François Dumont PR libstdc++/85768 diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index a4a026ed34a..b81a2c4b7fc 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -232,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended default constructor. explicit map(const allocator_type& __a) - : _M_t(_Compare(), _Pair_alloc_type(__a)) { } + : _M_t(_Pair_alloc_type(__a)) { } /// Allocator-extended copy constructor. map(const map& __m, const allocator_type& __a) @@ -246,14 +246,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended initialier-list constructor. map(initializer_list __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()); } /// Allocator-extended range constructor. template map(_InputIterator __first, _InputIterator __last, const allocator_type& __a) - : _M_t(_Compare(), _Pair_alloc_type(__a)) + : _M_t(_Pair_alloc_type(__a)) { _M_t._M_insert_unique(__first, __last); } #endif diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index fc8f454723d..23332ee53f8 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -229,7 +229,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended default constructor. explicit multimap(const allocator_type& __a) - : _M_t(_Compare(), _Pair_alloc_type(__a)) { } + : _M_t(_Pair_alloc_type(__a)) { } /// Allocator-extended copy constructor. multimap(const multimap& __m, const allocator_type& __a) @@ -243,14 +243,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended initialier-list constructor. multimap(initializer_list __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()); } /// Allocator-extended range constructor. template multimap(_InputIterator __first, _InputIterator __last, const allocator_type& __a) - : _M_t(_Compare(), _Pair_alloc_type(__a)) + : _M_t(_Pair_alloc_type(__a)) { _M_t._M_insert_equal(__first, __last); } #endif diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index f41f56c9485..829bc96e8b2 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -245,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended default constructor. explicit multiset(const allocator_type& __a) - : _M_t(_Compare(), _Key_alloc_type(__a)) { } + : _M_t(_Key_alloc_type(__a)) { } /// Allocator-extended copy constructor. multiset(const multiset& __m, const allocator_type& __a) @@ -259,14 +259,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended initialier-list constructor. multiset(initializer_list __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()); } /// Allocator-extended range constructor. template multiset(_InputIterator __first, _InputIterator __last, const allocator_type& __a) - : _M_t(_Compare(), _Key_alloc_type(__a)) + : _M_t(_Key_alloc_type(__a)) { _M_t._M_insert_equal(__first, __last); } /** diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 2e332efa477..41925265025 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended default constructor. explicit set(const allocator_type& __a) - : _M_t(_Compare(), _Key_alloc_type(__a)) { } + : _M_t(_Key_alloc_type(__a)) { } /// Allocator-extended copy constructor. set(const set& __x, const allocator_type& __a) @@ -263,14 +263,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /// Allocator-extended initialier-list constructor. set(initializer_list __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()); } /// Allocator-extended range constructor. template set(_InputIterator __first, _InputIterator __last, const allocator_type& __a) - : _M_t(_Compare(), _Key_alloc_type(__a)) + : _M_t(_Key_alloc_type(__a)) { _M_t._M_insert_unique(__first, __last); } /** diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index b87d6143e26..2403eba8eb3 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -715,6 +715,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #else _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) : _Node_allocator(std::move(__a)), _Base_key_compare(std::move(__x)), @@ -948,7 +953,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L _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)