Commit d72c3f0a by François Dumont

stl_map.h (map()): Make default.

2016-10-26  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_map.h (map()): Make default.
	* include/bits/stl_multimap.h (multimap()): Likewise.
	* include/bits/stl_multiset.h (multiset()): Likewise.
	* include/bits/stl_set.h (set()): Likewise.
	* include/bits/stl_tree.h (_Rb_tree_impl()): Add conditional noexcept.
	(_Rb_tree()): Make default.

From-SVN: r241601
parent 133634de
2016-10-26 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_map.h (map()): Make default.
* include/bits/stl_multimap.h (multimap()): Likewise.
* include/bits/stl_multiset.h (multiset()): Likewise.
* include/bits/stl_set.h (set()): Likewise.
* include/bits/stl_tree.h (_Rb_tree_impl()): Add conditional noexcept.
(_Rb_tree()): Make default.
2016-10-26 Bernd Edlinger <bernd.edlinger@hotmail.de> 2016-10-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR libstdc++/78110 PR libstdc++/78110
......
...@@ -167,11 +167,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -167,11 +167,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
map() #if __cplusplus < 201103L
_GLIBCXX_NOEXCEPT_IF( map() : _M_t() { }
is_nothrow_default_constructible<allocator_type>::value #else
&& is_nothrow_default_constructible<key_compare>::value) map() = default;
: _M_t() { } #endif
/** /**
* @brief Creates a %map with no elements. * @brief Creates a %map with no elements.
......
...@@ -164,11 +164,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -164,11 +164,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
multimap() #if __cplusplus < 201103L
_GLIBCXX_NOEXCEPT_IF( multimap() : _M_t() { }
is_nothrow_default_constructible<allocator_type>::value #else
&& is_nothrow_default_constructible<key_compare>::value) multimap() = default;
: _M_t() { } #endif
/** /**
* @brief Creates a %multimap with no elements. * @brief Creates a %multimap with no elements.
......
...@@ -144,11 +144,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -144,11 +144,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
multiset() #if __cplusplus < 201103L
_GLIBCXX_NOEXCEPT_IF( multiset() : _M_t() { }
is_nothrow_default_constructible<allocator_type>::value #else
&& is_nothrow_default_constructible<key_compare>::value) multiset() = default;
: _M_t() { } #endif
/** /**
* @brief Creates a %multiset with no elements. * @brief Creates a %multiset with no elements.
......
...@@ -147,11 +147,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -147,11 +147,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/** /**
* @brief Default constructor creates no elements. * @brief Default constructor creates no elements.
*/ */
set() #if __cplusplus < 201103L
_GLIBCXX_NOEXCEPT_IF( set() : _M_t() { }
is_nothrow_default_constructible<allocator_type>::value #else
&& is_nothrow_default_constructible<key_compare>::value) set() = default;
: _M_t() { } #endif
/** /**
* @brief Creates a %set with no elements. * @brief Creates a %set with no elements.
......
...@@ -602,10 +602,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -602,10 +602,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Rb_tree_impl : public _Node_allocator struct _Rb_tree_impl : public _Node_allocator
{ {
_Key_compare _M_key_compare; _Key_compare _M_key_compare;
_Rb_tree_node_base _M_header; _Rb_tree_node_base _M_header;
size_type _M_node_count; // Keeps track of size of tree. size_type _M_node_count; // Keeps track of size of tree.
_Rb_tree_impl() _Rb_tree_impl()
_GLIBCXX_NOEXCEPT_IF(
is_nothrow_default_constructible<_Node_allocator>::value
&& is_nothrow_default_constructible<_Key_compare>::value)
: _Node_allocator(), _M_key_compare(), _M_header(), : _Node_allocator(), _M_key_compare(), _M_header(),
_M_node_count(0) _M_node_count(0)
{ _M_initialize(); } { _M_initialize(); }
...@@ -639,7 +642,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -639,7 +642,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
this->_M_header._M_parent = 0; this->_M_header._M_parent = 0;
this->_M_header._M_left = &this->_M_header; this->_M_header._M_left = &this->_M_header;
this->_M_header._M_right = &this->_M_header; this->_M_header._M_right = &this->_M_header;
} }
}; };
_Rb_tree_impl<_Compare> _M_impl; _Rb_tree_impl<_Compare> _M_impl;
...@@ -831,7 +834,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -831,7 +834,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public: public:
// allocation/deallocation // allocation/deallocation
#if __cplusplus < 201103L
_Rb_tree() { } _Rb_tree() { }
#else
_Rb_tree() = default;
#endif
_Rb_tree(const _Compare& __comp, _Rb_tree(const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
......
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