set.h, [...]: Remove base class default constructor calls.
2011-06-29 François Dumont <francois.cppdevs@free.fr> * include/debug/set.h, unordered_map, multiset.h, forward_list, unordered_set, vector, deque, string, list, multimap.h: Remove base class default constructor calls. * include/debug/map.h: Likewise and cleanup several redefinition of base iterator typedef. From-SVN: r175665
This commit is contained in:
parent
5c0d88e64a
commit
4c2d93dbfa
12 changed files with 62 additions and 68 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-06-29 François Dumont <francois.cppdevs@free.fr>
|
||||
|
||||
* include/debug/set.h, unordered_map, multiset.h, forward_list,
|
||||
unordered_set, vector, deque, string, list, multimap.h: Remove
|
||||
base class default constructor calls.
|
||||
* include/debug/map.h: Likewise and cleanup several redefinition of
|
||||
base iterator typedef.
|
||||
|
||||
2011-06-29 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* libsupc++/eh_arm.c (__cxa_type_match): Construct address of
|
||||
|
|
|
@ -45,7 +45,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<deque> _Safe_base;
|
||||
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
|
@ -98,19 +97,19 @@ namespace __debug
|
|||
{ }
|
||||
|
||||
deque(const deque& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
deque(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
deque(deque&& __x)
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
deque(initializer_list<value_type> __l,
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __a), _Safe_base() { }
|
||||
: _Base(__l, __a) { }
|
||||
#endif
|
||||
|
||||
~deque() _GLIBCXX_NOEXCEPT { }
|
||||
|
|
|
@ -46,7 +46,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<forward_list<_Tp, _Alloc> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<forward_list> _Safe_base;
|
||||
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
|
|
|
@ -45,7 +45,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<list<_Tp, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::list<_Tp, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<list> _Safe_base;
|
||||
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
|
@ -100,19 +99,19 @@ namespace __debug
|
|||
|
||||
|
||||
list(const list& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
list(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
list(list&& __x) noexcept
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
list(initializer_list<value_type> __l,
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __a), _Safe_base() { }
|
||||
: _Base(__l, __a) { }
|
||||
#endif
|
||||
|
||||
~list() _GLIBCXX_NOEXCEPT { }
|
||||
|
@ -395,7 +394,7 @@ namespace __debug
|
|||
insert(iterator __p, initializer_list<value_type> __l)
|
||||
{
|
||||
__glibcxx_check_insert(__p);
|
||||
_Base::insert(__p, __l);
|
||||
_Base::insert(__p.base(), __l);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<map<_Key, _Tp, _Compare, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::map<_Key, _Tp, _Compare, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<map> _Safe_base;
|
||||
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
|
@ -61,9 +60,9 @@ namespace __debug
|
|||
typedef typename _Base::reference reference;
|
||||
typedef typename _Base::const_reference const_reference;
|
||||
|
||||
typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, map>
|
||||
typedef __gnu_debug::_Safe_iterator<_Base_iterator, map>
|
||||
iterator;
|
||||
typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, map>
|
||||
typedef __gnu_debug::_Safe_iterator<_Base_const_iterator, map>
|
||||
const_iterator;
|
||||
|
||||
typedef typename _Base::size_type size_type;
|
||||
|
@ -85,24 +84,24 @@ namespace __debug
|
|||
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
|
||||
__last)),
|
||||
__gnu_debug::__base(__last),
|
||||
__comp, __a), _Safe_base() { }
|
||||
__comp, __a) { }
|
||||
|
||||
map(const map& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
map(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
map(map&& __x)
|
||||
noexcept(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
map(initializer_list<value_type> __l,
|
||||
const _Compare& __c = _Compare(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __c, __a), _Safe_base() { }
|
||||
: _Base(__l, __c, __a) { }
|
||||
#endif
|
||||
|
||||
~map() _GLIBCXX_NOEXCEPT { }
|
||||
|
@ -206,7 +205,6 @@ namespace __debug
|
|||
std::pair<iterator, bool>
|
||||
insert(const value_type& __x)
|
||||
{
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
|
||||
return std::pair<iterator, bool>(iterator(__res.first, this),
|
||||
__res.second);
|
||||
|
@ -219,7 +217,6 @@ namespace __debug
|
|||
std::pair<iterator, bool>
|
||||
insert(_Pair&& __x)
|
||||
{
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
std::pair<_Base_iterator, bool> __res
|
||||
= _Base::insert(std::forward<_Pair>(__x));
|
||||
return std::pair<iterator, bool>(iterator(__res.first, this),
|
||||
|
@ -384,7 +381,6 @@ namespace __debug
|
|||
std::pair<iterator,iterator>
|
||||
equal_range(const key_type& __x)
|
||||
{
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
std::pair<_Base_iterator, _Base_iterator> __res =
|
||||
_Base::equal_range(__x);
|
||||
return std::make_pair(iterator(__res.first, this),
|
||||
|
@ -394,7 +390,6 @@ namespace __debug
|
|||
std::pair<const_iterator,const_iterator>
|
||||
equal_range(const key_type& __x) const
|
||||
{
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
std::pair<_Base_const_iterator, _Base_const_iterator> __res =
|
||||
_Base::equal_range(__x);
|
||||
return std::make_pair(const_iterator(__res.first, this),
|
||||
|
@ -411,7 +406,6 @@ namespace __debug
|
|||
void
|
||||
_M_invalidate_all()
|
||||
{
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
|
||||
this->_M_invalidate_if(_Not_equal(_M_base().end()));
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ namespace __debug
|
|||
_Compare, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base;
|
||||
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
|
@ -89,21 +88,21 @@ namespace __debug
|
|||
__comp, __a) { }
|
||||
|
||||
multimap(const multimap& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
multimap(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
multimap(multimap&& __x)
|
||||
noexcept(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
multimap(initializer_list<value_type> __l,
|
||||
const _Compare& __c = _Compare(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __c, __a), _Safe_base() { }
|
||||
: _Base(__l, __c, __a) { }
|
||||
#endif
|
||||
|
||||
~multimap() _GLIBCXX_NOEXCEPT { }
|
||||
|
|
|
@ -46,7 +46,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<multiset> _Safe_base;
|
||||
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
|
@ -88,21 +87,21 @@ namespace __debug
|
|||
__comp, __a) { }
|
||||
|
||||
multiset(const multiset& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
multiset(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
multiset(multiset&& __x)
|
||||
noexcept(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
multiset(initializer_list<value_type> __l,
|
||||
const _Compare& __comp = _Compare(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __comp, __a), _Safe_base() { }
|
||||
: _Base(__l, __comp, __a) { }
|
||||
#endif
|
||||
|
||||
~multiset() _GLIBCXX_NOEXCEPT { }
|
||||
|
|
|
@ -46,7 +46,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<set> _Safe_base;
|
||||
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
|
@ -88,21 +87,21 @@ namespace __debug
|
|||
__comp, __a) { }
|
||||
|
||||
set(const set& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
set(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
set(set&& __x)
|
||||
noexcept(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: _Base(std::move(__x)), _Safe_base()
|
||||
: _Base(std::move(__x))
|
||||
{ this->_M_swap(__x); }
|
||||
|
||||
set(initializer_list<value_type> __l,
|
||||
const _Compare& __comp = _Compare(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __comp, __a), _Safe_base() { }
|
||||
: _Base(__l, __comp, __a) { }
|
||||
#endif
|
||||
|
||||
~set() _GLIBCXX_NOEXCEPT { }
|
||||
|
@ -206,7 +205,6 @@ namespace __debug
|
|||
std::pair<iterator, bool>
|
||||
insert(value_type&& __x)
|
||||
{
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
std::pair<_Base_iterator, bool> __res
|
||||
= _Base::insert(std::move(__x));
|
||||
return std::pair<iterator, bool>(iterator(__res.first, this),
|
||||
|
|
|
@ -75,12 +75,12 @@ namespace __gnu_debug
|
|||
{ }
|
||||
|
||||
// Provides conversion from a release-mode string to a debug-mode string
|
||||
basic_string(const _Base& __base) : _Base(__base), _Safe_base() { }
|
||||
basic_string(const _Base& __base) : _Base(__base) { }
|
||||
|
||||
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
||||
// 42. string ctors specify wrong default allocator
|
||||
basic_string(const basic_string& __str)
|
||||
: _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base()
|
||||
: _Base(__str, 0, _Base::npos, __str.get_allocator())
|
||||
{ }
|
||||
|
||||
// _GLIBCXX_RESOLVE_LIB_DEFECTS
|
||||
|
|
|
@ -89,25 +89,25 @@ namespace __debug
|
|||
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
|
||||
__last)),
|
||||
__gnu_debug::__base(__last), __n,
|
||||
__hf, __eql, __a), _Safe_base() { }
|
||||
__hf, __eql, __a) { }
|
||||
|
||||
unordered_map(const unordered_map& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_map(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_map(unordered_map&& __x)
|
||||
noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
|
||||
is_nothrow_copy_constructible<_Pred>>::value)
|
||||
: _Base(std::move(__x)), _Safe_base() { }
|
||||
: _Base(std::move(__x)) { }
|
||||
|
||||
unordered_map(initializer_list<value_type> __l,
|
||||
size_type __n = 0,
|
||||
const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
|
||||
: _Base(__l, __n, __hf, __eql, __a) { }
|
||||
|
||||
~unordered_map() noexcept { }
|
||||
|
||||
|
@ -381,25 +381,25 @@ namespace __debug
|
|||
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
|
||||
__last)),
|
||||
__gnu_debug::__base(__last), __n,
|
||||
__hf, __eql, __a), _Safe_base() { }
|
||||
__hf, __eql, __a) { }
|
||||
|
||||
unordered_multimap(const unordered_multimap& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_multimap(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_multimap(unordered_multimap&& __x)
|
||||
noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
|
||||
is_nothrow_copy_constructible<_Pred>>::value)
|
||||
: _Base(std::move(__x)), _Safe_base() { }
|
||||
: _Base(std::move(__x)) { }
|
||||
|
||||
unordered_multimap(initializer_list<value_type> __l,
|
||||
size_type __n = 0,
|
||||
const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
|
||||
: _Base(__l, __n, __hf, __eql, __a) { }
|
||||
|
||||
~unordered_multimap() noexcept { }
|
||||
|
||||
|
|
|
@ -89,25 +89,25 @@ namespace __debug
|
|||
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
|
||||
__last)),
|
||||
__gnu_debug::__base(__last), __n,
|
||||
__hf, __eql, __a), _Safe_base() { }
|
||||
__hf, __eql, __a) { }
|
||||
|
||||
unordered_set(const unordered_set& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_set(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_set(unordered_set&& __x)
|
||||
noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
|
||||
is_nothrow_copy_constructible<_Pred>>::value)
|
||||
: _Base(std::move(__x)), _Safe_base() { }
|
||||
: _Base(std::move(__x)) { }
|
||||
|
||||
unordered_set(initializer_list<value_type> __l,
|
||||
size_type __n = 0,
|
||||
const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
|
||||
: _Base(__l, __n, __hf, __eql, __a) { }
|
||||
|
||||
~unordered_set() noexcept { }
|
||||
|
||||
|
@ -370,25 +370,25 @@ namespace __debug
|
|||
: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
|
||||
__last)),
|
||||
__gnu_debug::__base(__last), __n,
|
||||
__hf, __eql, __a), _Safe_base() { }
|
||||
__hf, __eql, __a) { }
|
||||
|
||||
unordered_multiset(const unordered_multiset& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_multiset(const _Base& __x)
|
||||
: _Base(__x), _Safe_base() { }
|
||||
: _Base(__x) { }
|
||||
|
||||
unordered_multiset(unordered_multiset&& __x)
|
||||
noexcept(__and_<is_nothrow_copy_constructible<_Hash>,
|
||||
is_nothrow_copy_constructible<_Pred>>::value)
|
||||
: _Base(std::move(__x)), _Safe_base() { }
|
||||
: _Base(std::move(__x)) { }
|
||||
|
||||
unordered_multiset(initializer_list<value_type> __l,
|
||||
size_type __n = 0,
|
||||
const hasher& __hf = hasher(),
|
||||
const key_equal& __eql = key_equal(),
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __n, __hf, __eql, __a), _Safe_base() { }
|
||||
: _Base(__l, __n, __hf, __eql, __a) { }
|
||||
|
||||
~unordered_multiset() noexcept { }
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ namespace __debug
|
|||
public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> >
|
||||
{
|
||||
typedef _GLIBCXX_STD_C::vector<_Tp, _Allocator> _Base;
|
||||
typedef __gnu_debug::_Safe_sequence<vector> _Safe_base;
|
||||
|
||||
typedef typename _Base::iterator _Base_iterator;
|
||||
typedef typename _Base::const_iterator _Base_const_iterator;
|
||||
|
@ -102,15 +101,15 @@ namespace __debug
|
|||
{ _M_update_guaranteed_capacity(); }
|
||||
|
||||
vector(const vector& __x)
|
||||
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
|
||||
: _Base(__x), _M_guaranteed_capacity(__x.size()) { }
|
||||
|
||||
/// Construction from a release-mode vector
|
||||
vector(const _Base& __x)
|
||||
: _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
|
||||
: _Base(__x), _M_guaranteed_capacity(__x.size()) { }
|
||||
|
||||
#ifdef __GXX_EXPERIMENTAL_CXX0X__
|
||||
vector(vector&& __x) noexcept
|
||||
: _Base(std::move(__x)), _Safe_base(),
|
||||
: _Base(std::move(__x)),
|
||||
_M_guaranteed_capacity(this->size())
|
||||
{
|
||||
this->_M_swap(__x);
|
||||
|
@ -119,7 +118,7 @@ namespace __debug
|
|||
|
||||
vector(initializer_list<value_type> __l,
|
||||
const allocator_type& __a = allocator_type())
|
||||
: _Base(__l, __a), _Safe_base(),
|
||||
: _Base(__l, __a),
|
||||
_M_guaranteed_capacity(__l.size()) { }
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue