Commit d15ac9d9 by Marc Glisse Committed by Marc Glisse

re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)

2013-09-20  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/allocator.h (__alloc_swap::_S_do_it,
	__shrink_to_fit_aux::_S_do_it): Mark as noexcept.
	* include/bits/basic_string.h (basic_string::_Rep) [_S_empty_rep,
	_M_is_leaked, _M_is_shared, _M_set_leaked, _M_set_sharable,
	_M_set_length_and_sharable, _M_dispose]: Likewise.
	(basic_string::_Alloc_hider::_Alloc_hider): Likewise.
	(basic_string) [_M_data, _M_rep, _M_ibegin, _M_iend, _M_limit,
	_M_disjunct, _M_copy, _M_move, _M_assign, _S_copy_chars, _S_compare,
	_S_empty_rep, shrink_to_fit, operator[] const, front const, back const]:
	Likewise.
	[clear]: Link to PR 56166.
	[swap]: Link to PR 58265.
	* include/bits/stl_deque.h (_Deque_iterator) [_S_buffer_size,
	_Deque_iterator, _M_const_cast, operator*, operator->, operator++,
	operator--, operator+=, operator+, operator-=, operator-, operator[],
	_M_set_node]: Mark as noexcept.
	(operator==(const _Deque_iterator&, const _Deque_iterator&),
	operator!=(const _Deque_iterator&, const _Deque_iterator&),
	operator<(const _Deque_iterator&, const _Deque_iterator&),
	operator>(const _Deque_iterator&, const _Deque_iterator&),
	operator<=(const _Deque_iterator&, const _Deque_iterator&),
	operator>=(const _Deque_iterator&, const _Deque_iterator&),
	operator-(const _Deque_iterator&, const _Deque_iterator&),
	operator+(ptrdiff_t, const _Deque_iterator&)): Likewise.
	(_Deque_base) [_Deque_base(const allocator_type&)]: Add missing call to
	_M_initialize_map.
	[~_Deque_base, _M_deallocate_node, _M_deallocate_map, _M_destroy_nodes]:
	Mark as noexcept.
	(_Deque_base::_Deque_impl) [_Deque_impl(const _Tp_alloc_type&),
	_Deque_impl(_Tp_alloc_type&&)]: Likewise.
	(deque) [_S_buffer_size, operator=(deque&&), shrink_to_fit, operator[],
	front, back, pop_front, pop_back, swap]: Likewise.
	[deque(), deque(const allocator_type&)]: Merge.
	* include/debug/deque (deque) [operator=(deque&&), shrink_to_fit,
	operator[], front, back, pop_front, pop_back, swap]: Mark as noexcept.
	* include/profile/deque (deque) [operator=(deque&&), operator[], front,
	back, pop_front, pop_back, swap]: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust line number.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r202781
parent d20e48b0
2013-09-20 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/58338
* include/bits/allocator.h (__alloc_swap::_S_do_it,
__shrink_to_fit_aux::_S_do_it): Mark as noexcept.
* include/bits/basic_string.h (basic_string::_Rep) [_S_empty_rep,
_M_is_leaked, _M_is_shared, _M_set_leaked, _M_set_sharable,
_M_set_length_and_sharable, _M_dispose]: Likewise.
(basic_string::_Alloc_hider::_Alloc_hider): Likewise.
(basic_string) [_M_data, _M_rep, _M_ibegin, _M_iend, _M_limit,
_M_disjunct, _M_copy, _M_move, _M_assign, _S_copy_chars, _S_compare,
_S_empty_rep, shrink_to_fit, operator[] const, front const, back const]:
Likewise.
[clear]: Link to PR 56166.
[swap]: Link to PR 58265.
* include/bits/stl_deque.h (_Deque_iterator) [_S_buffer_size,
_Deque_iterator, _M_const_cast, operator*, operator->, operator++,
operator--, operator+=, operator+, operator-=, operator-, operator[],
_M_set_node]: Mark as noexcept.
(operator==(const _Deque_iterator&, const _Deque_iterator&),
operator!=(const _Deque_iterator&, const _Deque_iterator&),
operator<(const _Deque_iterator&, const _Deque_iterator&),
operator>(const _Deque_iterator&, const _Deque_iterator&),
operator<=(const _Deque_iterator&, const _Deque_iterator&),
operator>=(const _Deque_iterator&, const _Deque_iterator&),
operator-(const _Deque_iterator&, const _Deque_iterator&),
operator+(ptrdiff_t, const _Deque_iterator&)): Likewise.
(_Deque_base) [_Deque_base(const allocator_type&)]: Add missing call to
_M_initialize_map.
[~_Deque_base, _M_deallocate_node, _M_deallocate_map, _M_destroy_nodes]:
Mark as noexcept.
(_Deque_base::_Deque_impl) [_Deque_impl(const _Tp_alloc_type&),
_Deque_impl(_Tp_alloc_type&&)]: Likewise.
(deque) [_S_buffer_size, operator=(deque&&), shrink_to_fit, operator[],
front, back, pop_front, pop_back, swap]: Likewise.
[deque(), deque(const allocator_type&)]: Merge.
* include/debug/deque (deque) [operator=(deque&&), shrink_to_fit,
operator[], front, back, pop_front, pop_back, swap]: Mark as noexcept.
* include/profile/deque (deque) [operator=(deque&&), operator[], front,
back, pop_front, pop_back, swap]: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust line number.
* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
2013-09-20 Alan Modra <amodra@gmail.com> 2013-09-20 Alan Modra <amodra@gmail.com>
* configure: Regenerate. * configure: Regenerate.
......
...@@ -158,13 +158,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -158,13 +158,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// To implement Option 3 of DR 431. // To implement Option 3 of DR 431.
template<typename _Alloc, bool = __is_empty(_Alloc)> template<typename _Alloc, bool = __is_empty(_Alloc)>
struct __alloc_swap struct __alloc_swap
{ static void _S_do_it(_Alloc&, _Alloc&) { } }; { static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
template<typename _Alloc> template<typename _Alloc>
struct __alloc_swap<_Alloc, false> struct __alloc_swap<_Alloc, false>
{ {
static void static void
_S_do_it(_Alloc& __one, _Alloc& __two) _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
{ {
// Precondition: swappable allocators. // Precondition: swappable allocators.
if (__one != __two) if (__one != __two)
...@@ -194,13 +194,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -194,13 +194,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= __or_<is_copy_constructible<typename _Tp::value_type>, = __or_<is_copy_constructible<typename _Tp::value_type>,
is_nothrow_move_constructible<typename _Tp::value_type>>::value> is_nothrow_move_constructible<typename _Tp::value_type>>::value>
struct __shrink_to_fit_aux struct __shrink_to_fit_aux
{ static bool _S_do_it(_Tp&) { return false; } }; { static bool _S_do_it(_Tp&) noexcept { return false; } };
template<typename _Tp> template<typename _Tp>
struct __shrink_to_fit_aux<_Tp, true> struct __shrink_to_fit_aux<_Tp, true>
{ {
static bool static bool
_S_do_it(_Tp& __c) _S_do_it(_Tp& __c) noexcept
{ {
__try __try
{ {
......
...@@ -178,7 +178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -178,7 +178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static size_type _S_empty_rep_storage[]; static size_type _S_empty_rep_storage[];
static _Rep& static _Rep&
_S_empty_rep() _S_empty_rep() _GLIBCXX_NOEXCEPT
{ {
// NB: Mild hack to avoid strict-aliasing warnings. Note that // NB: Mild hack to avoid strict-aliasing warnings. Note that
// _S_empty_rep_storage is never modified and the punning should // _S_empty_rep_storage is never modified and the punning should
...@@ -188,23 +188,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -188,23 +188,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
bool bool
_M_is_leaked() const _M_is_leaked() const _GLIBCXX_NOEXCEPT
{ return this->_M_refcount < 0; } { return this->_M_refcount < 0; }
bool bool
_M_is_shared() const _M_is_shared() const _GLIBCXX_NOEXCEPT
{ return this->_M_refcount > 0; } { return this->_M_refcount > 0; }
void void
_M_set_leaked() _M_set_leaked() _GLIBCXX_NOEXCEPT
{ this->_M_refcount = -1; } { this->_M_refcount = -1; }
void void
_M_set_sharable() _M_set_sharable() _GLIBCXX_NOEXCEPT
{ this->_M_refcount = 0; } { this->_M_refcount = 0; }
void void
_M_set_length_and_sharable(size_type __n) _M_set_length_and_sharable(size_type __n) _GLIBCXX_NOEXCEPT
{ {
#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
if (__builtin_expect(this != &_S_empty_rep(), false)) if (__builtin_expect(this != &_S_empty_rep(), false))
...@@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_create(size_type, size_type, const _Alloc&); _S_create(size_type, size_type, const _Alloc&);
void void
_M_dispose(const _Alloc& __a) _M_dispose(const _Alloc& __a) _GLIBCXX_NOEXCEPT
{ {
#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
if (__builtin_expect(this != &_S_empty_rep(), false)) if (__builtin_expect(this != &_S_empty_rep(), false))
...@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Use empty-base optimization: http://www.cantrip.org/emptyopt.html // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
struct _Alloc_hider : _Alloc struct _Alloc_hider : _Alloc
{ {
_Alloc_hider(_CharT* __dat, const _Alloc& __a) _Alloc_hider(_CharT* __dat, const _Alloc& __a) _GLIBCXX_NOEXCEPT
: _Alloc(__a), _M_p(__dat) { } : _Alloc(__a), _M_p(__dat) { }
_CharT* _M_p; // The actual data. _CharT* _M_p; // The actual data.
...@@ -289,25 +289,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -289,25 +289,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
mutable _Alloc_hider _M_dataplus; mutable _Alloc_hider _M_dataplus;
_CharT* _CharT*
_M_data() const _M_data() const _GLIBCXX_NOEXCEPT
{ return _M_dataplus._M_p; } { return _M_dataplus._M_p; }
_CharT* _CharT*
_M_data(_CharT* __p) _M_data(_CharT* __p) _GLIBCXX_NOEXCEPT
{ return (_M_dataplus._M_p = __p); } { return (_M_dataplus._M_p = __p); }
_Rep* _Rep*
_M_rep() const _M_rep() const _GLIBCXX_NOEXCEPT
{ return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); } { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
// For the internal use we have functions similar to `begin'/`end' // For the internal use we have functions similar to `begin'/`end'
// but they do not call _M_leak. // but they do not call _M_leak.
iterator iterator
_M_ibegin() const _M_ibegin() const _GLIBCXX_NOEXCEPT
{ return iterator(_M_data()); } { return iterator(_M_data()); }
iterator iterator
_M_iend() const _M_iend() const _GLIBCXX_NOEXCEPT
{ return iterator(_M_data() + this->size()); } { return iterator(_M_data() + this->size()); }
void void
...@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// NB: _M_limit doesn't check for a bad __pos value. // NB: _M_limit doesn't check for a bad __pos value.
size_type size_type
_M_limit(size_type __pos, size_type __off) const _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
{ {
const bool __testoff = __off < this->size() - __pos; const bool __testoff = __off < this->size() - __pos;
return __testoff ? __off : this->size() - __pos; return __testoff ? __off : this->size() - __pos;
...@@ -342,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -342,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// True if _Rep and source do not overlap. // True if _Rep and source do not overlap.
bool bool
_M_disjunct(const _CharT* __s) const _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
{ {
return (less<const _CharT*>()(__s, _M_data()) return (less<const _CharT*>()(__s, _M_data())
|| less<const _CharT*>()(_M_data() + this->size(), __s)); || less<const _CharT*>()(_M_data() + this->size(), __s));
...@@ -351,7 +351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -351,7 +351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// When __n = 1 way faster than the general multichar // When __n = 1 way faster than the general multichar
// traits_type::copy/move/assign. // traits_type::copy/move/assign.
static void static void
_M_copy(_CharT* __d, const _CharT* __s, size_type __n) _M_copy(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, *__s); traits_type::assign(*__d, *__s);
...@@ -360,7 +360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -360,7 +360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
static void static void
_M_move(_CharT* __d, const _CharT* __s, size_type __n) _M_move(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, *__s); traits_type::assign(*__d, *__s);
...@@ -369,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -369,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
static void static void
_M_assign(_CharT* __d, size_type __n, _CharT __c) _M_assign(_CharT* __d, size_type __n, _CharT __c) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, __c); traits_type::assign(*__d, __c);
...@@ -382,29 +382,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -382,29 +382,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<class _Iterator> template<class _Iterator>
static void static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2) _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
_GLIBCXX_NOEXCEPT
{ {
for (; __k1 != __k2; ++__k1, ++__p) for (; __k1 != __k2; ++__k1, ++__p)
traits_type::assign(*__p, *__k1); // These types are off. traits_type::assign(*__p, *__k1); // These types are off.
} }
static void static void
_S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
{ _S_copy_chars(__p, __k1.base(), __k2.base()); } { _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void static void
_S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2) _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
_GLIBCXX_NOEXCEPT
{ _S_copy_chars(__p, __k1.base(), __k2.base()); } { _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void static void
_S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
{ _M_copy(__p, __k1, __k2 - __k1); } { _M_copy(__p, __k1, __k2 - __k1); }
static void static void
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
_GLIBCXX_NOEXCEPT
{ _M_copy(__p, __k1, __k2 - __k1); } { _M_copy(__p, __k1, __k2 - __k1); }
static int static int
_S_compare(size_type __n1, size_type __n2) _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
{ {
const difference_type __d = difference_type(__n1 - __n2); const difference_type __d = difference_type(__n1 - __n2);
...@@ -423,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -423,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_leak_hard(); _M_leak_hard();
static _Rep& static _Rep&
_S_empty_rep() _S_empty_rep() _GLIBCXX_NOEXCEPT
{ return _Rep::_S_empty_rep(); } { return _Rep::_S_empty_rep(); }
public: public:
...@@ -756,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -756,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/// A non-binding request to reduce capacity() to size(). /// A non-binding request to reduce capacity() to size().
void void
shrink_to_fit() shrink_to_fit() _GLIBCXX_NOEXCEPT
{ {
if (capacity() > size()) if (capacity() > size())
{ {
...@@ -799,6 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -799,6 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/** /**
* Erases the string, making it empty. * Erases the string, making it empty.
*/ */
// PR 56166: this should not throw.
void void
clear() _GLIBCXX_NOEXCEPT clear() _GLIBCXX_NOEXCEPT
{ _M_mutate(0, this->size(), 0); } { _M_mutate(0, this->size(), 0); }
...@@ -823,7 +827,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -823,7 +827,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* see at().) * see at().)
*/ */
const_reference const_reference
operator[] (size_type __pos) const operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_ASSERT(__pos <= size()); _GLIBCXX_DEBUG_ASSERT(__pos <= size());
return _M_data()[__pos]; return _M_data()[__pos];
...@@ -903,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -903,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* element of the %string. * element of the %string.
*/ */
const_reference const_reference
front() const front() const _GLIBCXX_NOEXCEPT
{ return operator[](0); } { return operator[](0); }
/** /**
...@@ -919,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -919,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* last element of the %string. * last element of the %string.
*/ */
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ return operator[](this->size() - 1); } { return operator[](this->size() - 1); }
#endif #endif
...@@ -1787,6 +1791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1787,6 +1791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Exchanges the contents of this string with that of @a __s in constant * Exchanges the contents of this string with that of @a __s in constant
* time. * time.
*/ */
// PR 58265, this should be noexcept.
void void
swap(basic_string& __s); swap(basic_string& __s);
......
...@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator; typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator; typedef _Deque_iterator<_Tp, const _Tp&, const _Tp*> const_iterator;
static size_t _S_buffer_size() static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT
{ return __deque_buf_size(sizeof(_Tp)); } { return __deque_buf_size(sizeof(_Tp)); }
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
...@@ -125,31 +125,31 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -125,31 +125,31 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Tp* _M_last; _Tp* _M_last;
_Map_pointer _M_node; _Map_pointer _M_node;
_Deque_iterator(_Tp* __x, _Map_pointer __y) _Deque_iterator(_Tp* __x, _Map_pointer __y) _GLIBCXX_NOEXCEPT
: _M_cur(__x), _M_first(*__y), : _M_cur(__x), _M_first(*__y),
_M_last(*__y + _S_buffer_size()), _M_node(__y) { } _M_last(*__y + _S_buffer_size()), _M_node(__y) { }
_Deque_iterator() _Deque_iterator() _GLIBCXX_NOEXCEPT
: _M_cur(0), _M_first(0), _M_last(0), _M_node(0) { } : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) { }
_Deque_iterator(const iterator& __x) _Deque_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT
: _M_cur(__x._M_cur), _M_first(__x._M_first), : _M_cur(__x._M_cur), _M_first(__x._M_first),
_M_last(__x._M_last), _M_node(__x._M_node) { } _M_last(__x._M_last), _M_node(__x._M_node) { }
iterator iterator
_M_const_cast() const _M_const_cast() const _GLIBCXX_NOEXCEPT
{ return iterator(_M_cur, _M_node); } { return iterator(_M_cur, _M_node); }
reference reference
operator*() const operator*() const _GLIBCXX_NOEXCEPT
{ return *_M_cur; } { return *_M_cur; }
pointer pointer
operator->() const operator->() const _GLIBCXX_NOEXCEPT
{ return _M_cur; } { return _M_cur; }
_Self& _Self&
operator++() operator++() _GLIBCXX_NOEXCEPT
{ {
++_M_cur; ++_M_cur;
if (_M_cur == _M_last) if (_M_cur == _M_last)
...@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -161,7 +161,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_Self _Self
operator++(int) operator++(int) _GLIBCXX_NOEXCEPT
{ {
_Self __tmp = *this; _Self __tmp = *this;
++*this; ++*this;
...@@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_Self& _Self&
operator--() operator--() _GLIBCXX_NOEXCEPT
{ {
if (_M_cur == _M_first) if (_M_cur == _M_first)
{ {
...@@ -181,7 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -181,7 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_Self _Self
operator--(int) operator--(int) _GLIBCXX_NOEXCEPT
{ {
_Self __tmp = *this; _Self __tmp = *this;
--*this; --*this;
...@@ -189,7 +189,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -189,7 +189,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_Self& _Self&
operator+=(difference_type __n) operator+=(difference_type __n) _GLIBCXX_NOEXCEPT
{ {
const difference_type __offset = __n + (_M_cur - _M_first); const difference_type __offset = __n + (_M_cur - _M_first);
if (__offset >= 0 && __offset < difference_type(_S_buffer_size())) if (__offset >= 0 && __offset < difference_type(_S_buffer_size()))
...@@ -208,25 +208,25 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -208,25 +208,25 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_Self _Self
operator+(difference_type __n) const operator+(difference_type __n) const _GLIBCXX_NOEXCEPT
{ {
_Self __tmp = *this; _Self __tmp = *this;
return __tmp += __n; return __tmp += __n;
} }
_Self& _Self&
operator-=(difference_type __n) operator-=(difference_type __n) _GLIBCXX_NOEXCEPT
{ return *this += -__n; } { return *this += -__n; }
_Self _Self
operator-(difference_type __n) const operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
{ {
_Self __tmp = *this; _Self __tmp = *this;
return __tmp -= __n; return __tmp -= __n;
} }
reference reference
operator[](difference_type __n) const operator[](difference_type __n) const _GLIBCXX_NOEXCEPT
{ return *(*this + __n); } { return *(*this + __n); }
/** /**
...@@ -235,7 +235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -235,7 +235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* immediately afterwards, based on _M_first and _M_last. * immediately afterwards, based on _M_first and _M_last.
*/ */
void void
_M_set_node(_Map_pointer __new_node) _M_set_node(_Map_pointer __new_node) _GLIBCXX_NOEXCEPT
{ {
_M_node = __new_node; _M_node = __new_node;
_M_first = *__new_node; _M_first = *__new_node;
...@@ -249,33 +249,33 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -249,33 +249,33 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return __x._M_cur == __y._M_cur; } { return __x._M_cur == __y._M_cur; }
template<typename _Tp, typename _RefL, typename _PtrL, template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return __x._M_cur == __y._M_cur; } { return __x._M_cur == __y._M_cur; }
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return !(__x == __y); } { return !(__x == __y); }
template<typename _Tp, typename _RefL, typename _PtrL, template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return !(__x == __y); } { return !(__x == __y); }
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
: (__x._M_node < __y._M_node); } : (__x._M_node < __y._M_node); }
...@@ -283,47 +283,47 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -283,47 +283,47 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur) { return (__x._M_node == __y._M_node) ? (__x._M_cur < __y._M_cur)
: (__x._M_node < __y._M_node); } : (__x._M_node < __y._M_node); }
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return __y < __x; } { return __y < __x; }
template<typename _Tp, typename _RefL, typename _PtrL, template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return __y < __x; } { return __y < __x; }
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return !(__y < __x); } { return !(__y < __x); }
template<typename _Tp, typename _RefL, typename _PtrL, template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return !(__y < __x); } { return !(__y < __x); }
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline bool inline bool
operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ return !(__x < __y); } { return !(__x < __y); }
template<typename _Tp, typename _RefL, typename _PtrL, template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline bool inline bool
operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ return !(__x < __y); } { return !(__x < __y); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
...@@ -333,7 +333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -333,7 +333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type inline typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x, operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) const _Deque_iterator<_Tp, _Ref, _Ptr>& __y) _GLIBCXX_NOEXCEPT
{ {
return typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type return typename _Deque_iterator<_Tp, _Ref, _Ptr>::difference_type
(_Deque_iterator<_Tp, _Ref, _Ptr>::_S_buffer_size()) (_Deque_iterator<_Tp, _Ref, _Ptr>::_S_buffer_size())
...@@ -345,7 +345,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -345,7 +345,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typename _RefR, typename _PtrR> typename _RefR, typename _PtrR>
inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x, operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) const _Deque_iterator<_Tp, _RefR, _PtrR>& __y) _GLIBCXX_NOEXCEPT
{ {
return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type return typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
(_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size()) (_Deque_iterator<_Tp, _RefL, _PtrL>::_S_buffer_size())
...@@ -356,6 +356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -356,6 +356,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Ref, typename _Ptr> template<typename _Tp, typename _Ref, typename _Ptr>
inline _Deque_iterator<_Tp, _Ref, _Ptr> inline _Deque_iterator<_Tp, _Ref, _Ptr>
operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x) operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
_GLIBCXX_NOEXCEPT
{ return __x + __n; } { return __x + __n; }
template<typename _Tp> template<typename _Tp>
...@@ -466,7 +467,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -466,7 +467,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Deque_base(const allocator_type& __a) _Deque_base(const allocator_type& __a)
: _M_impl(__a) : _M_impl(__a)
{ } { _M_initialize_map(0); }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
_Deque_base(_Deque_base&& __x) _Deque_base(_Deque_base&& __x)
...@@ -483,7 +484,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -483,7 +484,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
#endif #endif
~_Deque_base(); ~_Deque_base() _GLIBCXX_NOEXCEPT;
protected: protected:
//This struct encapsulates the implementation of the std::deque //This struct encapsulates the implementation of the std::deque
...@@ -506,13 +507,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -506,13 +507,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_start(), _M_finish() _M_start(), _M_finish()
{ } { }
_Deque_impl(const _Tp_alloc_type& __a) _Deque_impl(const _Tp_alloc_type& __a) _GLIBCXX_NOEXCEPT
: _Tp_alloc_type(__a), _M_map(0), _M_map_size(0), : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0),
_M_start(), _M_finish() _M_start(), _M_finish()
{ } { }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
_Deque_impl(_Tp_alloc_type&& __a) _Deque_impl(_Tp_alloc_type&& __a) _GLIBCXX_NOEXCEPT
: _Tp_alloc_type(std::move(__a)), _M_map(0), _M_map_size(0), : _Tp_alloc_type(std::move(__a)), _M_map(0), _M_map_size(0),
_M_start(), _M_finish() _M_start(), _M_finish()
{ } { }
...@@ -538,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -538,7 +539,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
void void
_M_deallocate_node(_Tp* __p) _M_deallocate_node(_Tp* __p) _GLIBCXX_NOEXCEPT
{ {
_M_impl._Tp_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp))); _M_impl._Tp_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
} }
...@@ -548,13 +549,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -548,13 +549,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ return _M_get_map_allocator().allocate(__n); } { return _M_get_map_allocator().allocate(__n); }
void void
_M_deallocate_map(_Tp** __p, size_t __n) _M_deallocate_map(_Tp** __p, size_t __n) _GLIBCXX_NOEXCEPT
{ _M_get_map_allocator().deallocate(__p, __n); } { _M_get_map_allocator().deallocate(__p, __n); }
protected: protected:
void _M_initialize_map(size_t); void _M_initialize_map(size_t);
void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish); void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish); void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) _GLIBCXX_NOEXCEPT;
enum { _S_initial_map_size = 8 }; enum { _S_initial_map_size = 8 };
_Deque_impl _M_impl; _Deque_impl _M_impl;
...@@ -562,7 +563,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -562,7 +563,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
_Deque_base<_Tp, _Alloc>:: _Deque_base<_Tp, _Alloc>::
~_Deque_base() ~_Deque_base() _GLIBCXX_NOEXCEPT
{ {
if (this->_M_impl._M_map) if (this->_M_impl._M_map)
{ {
...@@ -640,7 +641,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -640,7 +641,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc> template<typename _Tp, typename _Alloc>
void void
_Deque_base<_Tp, _Alloc>:: _Deque_base<_Tp, _Alloc>::
_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish) _GLIBCXX_NOEXCEPT
{ {
for (_Tp** __n = __nstart; __n < __nfinish; ++__n) for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
_M_deallocate_node(*__n); _M_deallocate_node(*__n);
...@@ -758,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -758,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
protected: protected:
typedef pointer* _Map_pointer; typedef pointer* _Map_pointer;
static size_t _S_buffer_size() static size_t _S_buffer_size() _GLIBCXX_NOEXCEPT
{ return __deque_buf_size(sizeof(_Tp)); } { return __deque_buf_size(sizeof(_Tp)); }
// Functions controlling memory layout, and nothing else. // Functions controlling memory layout, and nothing else.
...@@ -781,18 +782,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -781,18 +782,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
// [23.2.1.1] construct/copy/destroy // [23.2.1.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section) // (assign() and get_allocator() are also listed in this section)
/** /**
* @brief Default constructor creates no elements.
*/
deque()
: _Base() { }
/**
* @brief Creates a %deque with no elements. * @brief Creates a %deque with no elements.
* @param __a An allocator object. * @param __a An allocator object.
*/ */
explicit explicit
deque(const allocator_type& __a) deque(const allocator_type& __a = allocator_type())
: _Base(__a, 0) { } : _Base(__a) { }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/** /**
...@@ -940,7 +935,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -940,7 +935,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* @a __x is a valid, but unspecified %deque. * @a __x is a valid, but unspecified %deque.
*/ */
deque& deque&
operator=(deque&& __x) operator=(deque&& __x) noexcept
{ {
// NB: DR 1204. // NB: DR 1204.
// NB: DR 675. // NB: DR 675.
...@@ -1220,7 +1215,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1220,7 +1215,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/** A non-binding request to reduce memory use. */ /** A non-binding request to reduce memory use. */
void void
shrink_to_fit() shrink_to_fit() noexcept
{ _M_shrink_to_fit(); } { _M_shrink_to_fit(); }
#endif #endif
...@@ -1245,7 +1240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1245,7 +1240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* see at().) * see at().)
*/ */
reference reference
operator[](size_type __n) operator[](size_type __n) _GLIBCXX_NOEXCEPT
{ return this->_M_impl._M_start[difference_type(__n)]; } { return this->_M_impl._M_start[difference_type(__n)]; }
/** /**
...@@ -1260,7 +1255,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1260,7 +1255,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* see at().) * see at().)
*/ */
const_reference const_reference
operator[](size_type __n) const operator[](size_type __n) const _GLIBCXX_NOEXCEPT
{ return this->_M_impl._M_start[difference_type(__n)]; } { return this->_M_impl._M_start[difference_type(__n)]; }
protected: protected:
...@@ -1314,7 +1309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1314,7 +1309,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* element of the %deque. * element of the %deque.
*/ */
reference reference
front() front() _GLIBCXX_NOEXCEPT
{ return *begin(); } { return *begin(); }
/** /**
...@@ -1322,7 +1317,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1322,7 +1317,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* element of the %deque. * element of the %deque.
*/ */
const_reference const_reference
front() const front() const _GLIBCXX_NOEXCEPT
{ return *begin(); } { return *begin(); }
/** /**
...@@ -1330,7 +1325,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1330,7 +1325,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* %deque. * %deque.
*/ */
reference reference
back() back() _GLIBCXX_NOEXCEPT
{ {
iterator __tmp = end(); iterator __tmp = end();
--__tmp; --__tmp;
...@@ -1342,7 +1337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1342,7 +1337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* element of the %deque. * element of the %deque.
*/ */
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ {
const_iterator __tmp = end(); const_iterator __tmp = end();
--__tmp; --__tmp;
...@@ -1422,7 +1417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1422,7 +1417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* needed, it should be retrieved before pop_front() is called. * needed, it should be retrieved before pop_front() is called.
*/ */
void void
pop_front() pop_front() _GLIBCXX_NOEXCEPT
{ {
if (this->_M_impl._M_start._M_cur if (this->_M_impl._M_start._M_cur
!= this->_M_impl._M_start._M_last - 1) != this->_M_impl._M_start._M_last - 1)
...@@ -1443,7 +1438,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1443,7 +1438,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* needed, it should be retrieved before pop_back() is called. * needed, it should be retrieved before pop_back() is called.
*/ */
void void
pop_back() pop_back() _GLIBCXX_NOEXCEPT
{ {
if (this->_M_impl._M_finish._M_cur if (this->_M_impl._M_finish._M_cur
!= this->_M_impl._M_finish._M_first) != this->_M_impl._M_finish._M_first)
...@@ -1655,7 +1650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -1655,7 +1650,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* std::swap(d1,d2) will feed to this function. * std::swap(d1,d2) will feed to this function.
*/ */
void void
swap(deque& __x) swap(deque& __x) _GLIBCXX_NOEXCEPT
{ {
std::swap(this->_M_impl._M_start, __x._M_impl._M_start); std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish); std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
......
...@@ -128,7 +128,7 @@ namespace __debug ...@@ -128,7 +128,7 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
deque& deque&
operator=(deque&& __x) operator=(deque&& __x) noexcept
{ {
// NB: DR 1204. // NB: DR 1204.
// NB: DR 675. // NB: DR 675.
...@@ -287,7 +287,7 @@ namespace __debug ...@@ -287,7 +287,7 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
void void
shrink_to_fit() shrink_to_fit() noexcept
{ {
if (_Base::_M_shrink_to_fit()) if (_Base::_M_shrink_to_fit())
this->_M_invalidate_all(); this->_M_invalidate_all();
...@@ -298,14 +298,14 @@ namespace __debug ...@@ -298,14 +298,14 @@ namespace __debug
// element access: // element access:
reference reference
operator[](size_type __n) operator[](size_type __n) _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_subscript(__n); __glibcxx_check_subscript(__n);
return _M_base()[__n]; return _M_base()[__n];
} }
const_reference const_reference
operator[](size_type __n) const operator[](size_type __n) const _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_subscript(__n); __glibcxx_check_subscript(__n);
return _M_base()[__n]; return _M_base()[__n];
...@@ -314,28 +314,28 @@ namespace __debug ...@@ -314,28 +314,28 @@ namespace __debug
using _Base::at; using _Base::at;
reference reference
front() front() _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
return _Base::front(); return _Base::front();
} }
const_reference const_reference
front() const front() const _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
return _Base::front(); return _Base::front();
} }
reference reference
back() back() _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
return _Base::back(); return _Base::back();
} }
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
return _Base::back(); return _Base::back();
...@@ -468,7 +468,7 @@ namespace __debug ...@@ -468,7 +468,7 @@ namespace __debug
#endif #endif
void void
pop_front() pop_front() _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
this->_M_invalidate_if(_Equal(_Base::begin())); this->_M_invalidate_if(_Equal(_Base::begin()));
...@@ -476,7 +476,7 @@ namespace __debug ...@@ -476,7 +476,7 @@ namespace __debug
} }
void void
pop_back() pop_back() _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_nonempty(); __glibcxx_check_nonempty();
this->_M_invalidate_if(_Equal(--_Base::end())); this->_M_invalidate_if(_Equal(--_Base::end()));
...@@ -556,7 +556,7 @@ namespace __debug ...@@ -556,7 +556,7 @@ namespace __debug
} }
void void
swap(deque& __x) swap(deque& __x) _GLIBCXX_NOEXCEPT
{ {
_Base::swap(__x); _Base::swap(__x);
this->_M_swap(__x); this->_M_swap(__x);
......
...@@ -117,7 +117,7 @@ namespace __profile ...@@ -117,7 +117,7 @@ namespace __profile
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
deque& deque&
operator=(deque&& __x) operator=(deque&& __x) noexcept
{ {
// NB: DR 1204. // NB: DR 1204.
// NB: DR 675. // NB: DR 675.
...@@ -245,13 +245,13 @@ namespace __profile ...@@ -245,13 +245,13 @@ namespace __profile
// element access: // element access:
reference reference
operator[](size_type __n) operator[](size_type __n) _GLIBCXX_NOEXCEPT
{ {
return _M_base()[__n]; return _M_base()[__n];
} }
const_reference const_reference
operator[](size_type __n) const operator[](size_type __n) const _GLIBCXX_NOEXCEPT
{ {
return _M_base()[__n]; return _M_base()[__n];
} }
...@@ -259,25 +259,25 @@ namespace __profile ...@@ -259,25 +259,25 @@ namespace __profile
using _Base::at; using _Base::at;
reference reference
front() front() _GLIBCXX_NOEXCEPT
{ {
return _Base::front(); return _Base::front();
} }
const_reference const_reference
front() const front() const _GLIBCXX_NOEXCEPT
{ {
return _Base::front(); return _Base::front();
} }
reference reference
back() back() _GLIBCXX_NOEXCEPT
{ {
return _Base::back(); return _Base::back();
} }
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ {
return _Base::back(); return _Base::back();
} }
...@@ -375,13 +375,13 @@ namespace __profile ...@@ -375,13 +375,13 @@ namespace __profile
#endif #endif
void void
pop_front() pop_front() _GLIBCXX_NOEXCEPT
{ {
_Base::pop_front(); _Base::pop_front();
} }
void void
pop_back() pop_back() _GLIBCXX_NOEXCEPT
{ {
_Base::pop_back(); _Base::pop_back();
} }
...@@ -409,7 +409,7 @@ namespace __profile ...@@ -409,7 +409,7 @@ namespace __profile
} }
void void
swap(deque& __x) swap(deque& __x) _GLIBCXX_NOEXCEPT
{ {
_Base::swap(__x); _Base::swap(__x);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-do compile } // { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1760 } // { dg-error "no matching" "" { target *-*-* } 1755 }
#include <deque> #include <deque>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-do compile } // { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1693 } // { dg-error "no matching" "" { target *-*-* } 1688 }
#include <deque> #include <deque>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-do compile } // { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1693 } // { dg-error "no matching" "" { target *-*-* } 1688 }
#include <deque> #include <deque>
#include <utility> #include <utility>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-do compile } // { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1844 } // { dg-error "no matching" "" { target *-*-* } 1839 }
#include <deque> #include <deque>
......
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