Commit 5d861bf2 by Paolo Carlini Committed by Paolo Carlini

initializer_list: Use noexcept specifier.

2011-05-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* libsupc++/initializer_list: Use noexcept specifier.
	(initializer_list<>::size, begin, end): Qualify as const.
	* include/bits/move.h (__addressof, forward, move, addressof): Specify
	as noexcept.
	* include/std/bitset: Use noexcept specifier throughout.
	* include/debug/bitset: Update.
	* include/profile/bitset: Likewise.

From-SVN: r173871
parent 0bda47a3
2011-05-18 Paolo Carlini <paolo.carlini@oracle.com>
* libsupc++/initializer_list: Use noexcept specifier.
(initializer_list<>::size, begin, end): Qualify as const.
* include/bits/move.h (__addressof, forward, move, addressof): Specify
as noexcept.
* include/std/bitset: Use noexcept specifier throughout.
* include/debug/bitset: Update.
* include/profile/bitset: Likewise.
2011-05-17 Paolo Carlini <paolo.carlini@oracle.com> 2011-05-17 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/tuple: Use noexcept where appropriate. * include/std/tuple: Use noexcept where appropriate.
......
...@@ -40,7 +40,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -40,7 +40,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Used, in C++03 mode too, by allocators, etc. // Used, in C++03 mode too, by allocators, etc.
template<typename _Tp> template<typename _Tp>
inline _Tp* inline _Tp*
__addressof(_Tp& __r) __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
{ {
return reinterpret_cast<_Tp*> return reinterpret_cast<_Tp*>
(&const_cast<char&>(reinterpret_cast<const volatile char&>(__r))); (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
...@@ -59,12 +59,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -59,12 +59,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// forward (as per N3143) /// forward (as per N3143)
template<typename _Tp> template<typename _Tp>
inline _Tp&& inline _Tp&&
forward(typename std::remove_reference<_Tp>::type& __t) forward(typename std::remove_reference<_Tp>::type& __t) noexcept
{ return static_cast<_Tp&&>(__t); } { return static_cast<_Tp&&>(__t); }
template<typename _Tp> template<typename _Tp>
inline _Tp&& inline _Tp&&
forward(typename std::remove_reference<_Tp>::type&& __t) forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
{ {
static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument" static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
" substituting _Tp is an lvalue reference type"); " substituting _Tp is an lvalue reference type");
...@@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/ */
template<typename _Tp> template<typename _Tp>
inline typename std::remove_reference<_Tp>::type&& inline typename std::remove_reference<_Tp>::type&&
move(_Tp&& __t) move(_Tp&& __t) noexcept
{ return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
/** /**
...@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/ */
template<typename _Tp> template<typename _Tp>
inline _Tp* inline _Tp*
addressof(_Tp& __r) addressof(_Tp& __r) noexcept
{ return std::__addressof(__r); } { return std::__addressof(__r); }
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
...@@ -135,6 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -135,6 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp> template<typename _Tp>
inline void inline void
swap(_Tp& __a, _Tp& __b) swap(_Tp& __a, _Tp& __b)
// noexcept has to wait is_nothrow_move_assignable
{ {
// concept requirements // concept requirements
__glibcxx_function_requires(_SGIAssignableConcept<_Tp>) __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
...@@ -149,6 +150,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -149,6 +150,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, size_t _Nm> template<typename _Tp, size_t _Nm>
inline void inline void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
// noexcept waits for c++/49045
{ {
for (size_t __n = 0; __n < _Nm; ++__n) for (size_t __n = 0; __n < _Nm; ++__n)
swap(__a[__n], __b[__n]); swap(__a[__n], __b[__n]);
......
// Debugging bitset implementation -*- C++ -*- // Debugging bitset implementation -*- C++ -*-
// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 // Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -66,19 +66,19 @@ namespace __debug ...@@ -66,19 +66,19 @@ namespace __debug
reference(); reference();
reference(const _Base_ref& __base, reference(const _Base_ref& __base,
bitset* __seq __attribute__((__unused__))) bitset* __seq __attribute__((__unused__))) _GLIBCXX_NOEXCEPT
: _Base_ref(__base) : _Base_ref(__base)
, _Safe_iterator_base(__seq, false) , _Safe_iterator_base(__seq, false)
{ } { }
public: public:
reference(const reference& __x) reference(const reference& __x) _GLIBCXX_NOEXCEPT
: _Base_ref(__x) : _Base_ref(__x)
, _Safe_iterator_base(__x, false) , _Safe_iterator_base(__x, false)
{ } { }
reference& reference&
operator=(bool __x) operator=(bool __x) _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_VERIFY(! this->_M_singular(), _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
_M_message(__gnu_debug::__msg_bad_bitset_write) _M_message(__gnu_debug::__msg_bad_bitset_write)
...@@ -88,7 +88,7 @@ namespace __debug ...@@ -88,7 +88,7 @@ namespace __debug
} }
reference& reference&
operator=(const reference& __x) operator=(const reference& __x) _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_VERIFY(! __x._M_singular(), _GLIBCXX_DEBUG_VERIFY(! __x._M_singular(),
_M_message(__gnu_debug::__msg_bad_bitset_read) _M_message(__gnu_debug::__msg_bad_bitset_read)
...@@ -101,7 +101,7 @@ namespace __debug ...@@ -101,7 +101,7 @@ namespace __debug
} }
bool bool
operator~() const operator~() const _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_VERIFY(! this->_M_singular(), _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
_M_message(__gnu_debug::__msg_bad_bitset_read) _M_message(__gnu_debug::__msg_bad_bitset_read)
...@@ -109,7 +109,7 @@ namespace __debug ...@@ -109,7 +109,7 @@ namespace __debug
return ~(*static_cast<const _Base_ref*>(this)); return ~(*static_cast<const _Base_ref*>(this));
} }
operator bool() const operator bool() const _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_VERIFY(! this->_M_singular(), _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
_M_message(__gnu_debug::__msg_bad_bitset_read) _M_message(__gnu_debug::__msg_bad_bitset_read)
...@@ -118,7 +118,7 @@ namespace __debug ...@@ -118,7 +118,7 @@ namespace __debug
} }
reference& reference&
flip() flip() _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_VERIFY(! this->_M_singular(), _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
_M_message(__gnu_debug::__msg_bad_bitset_flip) _M_message(__gnu_debug::__msg_bad_bitset_flip)
...@@ -130,10 +130,11 @@ namespace __debug ...@@ -130,10 +130,11 @@ namespace __debug
#endif #endif
// 23.3.5.1 constructors: // 23.3.5.1 constructors:
_GLIBCXX_CONSTEXPR bitset() : _Base() { } _GLIBCXX_CONSTEXPR bitset() _GLIBCXX_NOEXCEPT
: _Base() { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
constexpr bitset(unsigned long long __val) constexpr bitset(unsigned long long __val) noexcept
#else #else
bitset(unsigned long __val) bitset(unsigned long __val)
#endif #endif
...@@ -173,42 +174,42 @@ namespace __debug ...@@ -173,42 +174,42 @@ namespace __debug
// 23.3.5.2 bitset operations: // 23.3.5.2 bitset operations:
bitset<_Nb>& bitset<_Nb>&
operator&=(const bitset<_Nb>& __rhs) operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() &= __rhs; _M_base() &= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator|=(const bitset<_Nb>& __rhs) operator|=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() |= __rhs; _M_base() |= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator^=(const bitset<_Nb>& __rhs) operator^=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() ^= __rhs; _M_base() ^= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator<<=(size_t __pos) operator<<=(size_t __pos) _GLIBCXX_NOEXCEPT
{ {
_M_base() <<= __pos; _M_base() <<= __pos;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator>>=(size_t __pos) operator>>=(size_t __pos) _GLIBCXX_NOEXCEPT
{ {
_M_base() >>= __pos; _M_base() >>= __pos;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
set() set() _GLIBCXX_NOEXCEPT
{ {
_Base::set(); _Base::set();
return *this; return *this;
...@@ -224,7 +225,7 @@ namespace __debug ...@@ -224,7 +225,7 @@ namespace __debug
} }
bitset<_Nb>& bitset<_Nb>&
reset() reset() _GLIBCXX_NOEXCEPT
{ {
_Base::reset(); _Base::reset();
return *this; return *this;
...@@ -237,10 +238,12 @@ namespace __debug ...@@ -237,10 +238,12 @@ namespace __debug
return *this; return *this;
} }
bitset<_Nb> operator~() const { return bitset(~_M_base()); } bitset<_Nb>
operator~() const _GLIBCXX_NOEXCEPT
{ return bitset(~_M_base()); }
bitset<_Nb>& bitset<_Nb>&
flip() flip() _GLIBCXX_NOEXCEPT
{ {
_Base::flip(); _Base::flip();
return *this; return *this;
...@@ -346,11 +349,11 @@ namespace __debug ...@@ -346,11 +349,11 @@ namespace __debug
using _Base::size; using _Base::size;
bool bool
operator==(const bitset<_Nb>& __rhs) const operator==(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() == __rhs; } { return _M_base() == __rhs; }
bool bool
operator!=(const bitset<_Nb>& __rhs) const operator!=(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() != __rhs; } { return _M_base() != __rhs; }
using _Base::test; using _Base::test;
...@@ -359,33 +362,35 @@ namespace __debug ...@@ -359,33 +362,35 @@ namespace __debug
using _Base::none; using _Base::none;
bitset<_Nb> bitset<_Nb>
operator<<(size_t __pos) const operator<<(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() << __pos); } { return bitset<_Nb>(_M_base() << __pos); }
bitset<_Nb> bitset<_Nb>
operator>>(size_t __pos) const operator>>(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() >> __pos); } { return bitset<_Nb>(_M_base() >> __pos); }
_Base& _Base&
_M_base() { return *this; } _M_base() _GLIBCXX_NOEXCEPT
{ return *this; }
const _Base& const _Base&
_M_base() const { return *this; } _M_base() const _GLIBCXX_NOEXCEPT
{ return *this; }
}; };
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) &= __y; } { return bitset<_Nb>(__x) &= __y; }
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) |= __y; } { return bitset<_Nb>(__x) |= __y; }
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) ^= __y; } { return bitset<_Nb>(__x) ^= __y; }
template<typename _CharT, typename _Traits, size_t _Nb> template<typename _CharT, typename _Traits, size_t _Nb>
......
// Profiling bitset implementation -*- C++ -*- // Profiling bitset implementation -*- C++ -*-
// Copyright (C) 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -52,42 +52,42 @@ namespace __profile ...@@ -52,42 +52,42 @@ namespace __profile
friend class bitset; friend class bitset;
reference(); reference();
reference(const _Base_ref& __base, bitset* __seq) reference(const _Base_ref& __base, bitset* __seq) _GLIBCXX_NOEXCEPT
: _Base_ref(__base) : _Base_ref(__base)
{ } { }
public: public:
reference(const reference& __x) reference(const reference& __x) _GLIBCXX_NOEXCEPT
: _Base_ref(__x) : _Base_ref(__x)
{ } { }
reference& reference&
operator=(bool __x) operator=(bool __x) _GLIBCXX_NOEXCEPT
{ {
*static_cast<_Base_ref*>(this) = __x; *static_cast<_Base_ref*>(this) = __x;
return *this; return *this;
} }
reference& reference&
operator=(const reference& __x) operator=(const reference& __x) _GLIBCXX_NOEXCEPT
{ {
*static_cast<_Base_ref*>(this) = __x; *static_cast<_Base_ref*>(this) = __x;
return *this; return *this;
} }
bool bool
operator~() const operator~() const _GLIBCXX_NOEXCEPT
{ {
return ~(*static_cast<const _Base_ref*>(this)); return ~(*static_cast<const _Base_ref*>(this));
} }
operator bool() const operator bool() const _GLIBCXX_NOEXCEPT
{ {
return *static_cast<const _Base_ref*>(this); return *static_cast<const _Base_ref*>(this);
} }
reference& reference&
flip() flip() _GLIBCXX_NOEXCEPT
{ {
_Base_ref::flip(); _Base_ref::flip();
return *this; return *this;
...@@ -95,10 +95,11 @@ namespace __profile ...@@ -95,10 +95,11 @@ namespace __profile
}; };
// 23.3.5.1 constructors: // 23.3.5.1 constructors:
_GLIBCXX_CONSTEXPR bitset() : _Base() { } _GLIBCXX_CONSTEXPR bitset() _GLIBCXX_NOEXCEPT
: _Base() { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
constexpr bitset(unsigned long long __val) constexpr bitset(unsigned long long __val) noexcept
#else #else
bitset(unsigned long __val) bitset(unsigned long __val)
#endif #endif
...@@ -138,42 +139,42 @@ namespace __profile ...@@ -138,42 +139,42 @@ namespace __profile
// 23.3.5.2 bitset operations: // 23.3.5.2 bitset operations:
bitset<_Nb>& bitset<_Nb>&
operator&=(const bitset<_Nb>& __rhs) operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() &= __rhs; _M_base() &= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator|=(const bitset<_Nb>& __rhs) operator|=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() |= __rhs; _M_base() |= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator^=(const bitset<_Nb>& __rhs) operator^=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
{ {
_M_base() ^= __rhs; _M_base() ^= __rhs;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator<<=(size_t __pos) operator<<=(size_t __pos) _GLIBCXX_NOEXCEPT
{ {
_M_base() <<= __pos; _M_base() <<= __pos;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
operator>>=(size_t __pos) operator>>=(size_t __pos) _GLIBCXX_NOEXCEPT
{ {
_M_base() >>= __pos; _M_base() >>= __pos;
return *this; return *this;
} }
bitset<_Nb>& bitset<_Nb>&
set() set() _GLIBCXX_NOEXCEPT
{ {
_Base::set(); _Base::set();
return *this; return *this;
...@@ -189,7 +190,7 @@ namespace __profile ...@@ -189,7 +190,7 @@ namespace __profile
} }
bitset<_Nb>& bitset<_Nb>&
reset() reset() _GLIBCXX_NOEXCEPT
{ {
_Base::reset(); _Base::reset();
return *this; return *this;
...@@ -202,10 +203,12 @@ namespace __profile ...@@ -202,10 +203,12 @@ namespace __profile
return *this; return *this;
} }
bitset<_Nb> operator~() const { return bitset(~_M_base()); } bitset<_Nb>
operator~() const _GLIBCXX_NOEXCEPT
{ return bitset(~_M_base()); }
bitset<_Nb>& bitset<_Nb>&
flip() flip() _GLIBCXX_NOEXCEPT
{ {
_Base::flip(); _Base::flip();
return *this; return *this;
...@@ -305,11 +308,11 @@ namespace __profile ...@@ -305,11 +308,11 @@ namespace __profile
using _Base::size; using _Base::size;
bool bool
operator==(const bitset<_Nb>& __rhs) const operator==(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() == __rhs; } { return _M_base() == __rhs; }
bool bool
operator!=(const bitset<_Nb>& __rhs) const operator!=(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
{ return _M_base() != __rhs; } { return _M_base() != __rhs; }
using _Base::test; using _Base::test;
...@@ -318,33 +321,35 @@ namespace __profile ...@@ -318,33 +321,35 @@ namespace __profile
using _Base::none; using _Base::none;
bitset<_Nb> bitset<_Nb>
operator<<(size_t __pos) const operator<<(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() << __pos); } { return bitset<_Nb>(_M_base() << __pos); }
bitset<_Nb> bitset<_Nb>
operator>>(size_t __pos) const operator>>(size_t __pos) const _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(_M_base() >> __pos); } { return bitset<_Nb>(_M_base() >> __pos); }
_Base& _Base&
_M_base() { return *this; } _M_base() _GLIBCXX_NOEXCEPT
{ return *this; }
const _Base& const _Base&
_M_base() const { return *this; } _M_base() const _GLIBCXX_NOEXCEPT
{ return *this; }
}; };
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) &= __y; } { return bitset<_Nb>(__x) &= __y; }
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) |= __y; } { return bitset<_Nb>(__x) |= __y; }
template<size_t _Nb> template<size_t _Nb>
bitset<_Nb> bitset<_Nb>
operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
{ return bitset<_Nb>(__x) ^= __y; } { return bitset<_Nb>(__x) ^= __y; }
template<typename _CharT, typename _Traits, size_t _Nb> template<typename _CharT, typename _Traits, size_t _Nb>
......
// std::initializer_list support -*- C++ -*- // std::initializer_list support -*- C++ -*-
// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of GCC. // This file is part of GCC.
// //
...@@ -61,19 +61,20 @@ namespace std ...@@ -61,19 +61,20 @@ namespace std
: _M_array(__a), _M_len(__l) { } : _M_array(__a), _M_len(__l) { }
public: public:
constexpr initializer_list() : _M_array(0), _M_len(0) { } constexpr initializer_list() noexcept
: _M_array(0), _M_len(0) { }
// Number of elements. // Number of elements.
constexpr size_type constexpr size_type
size() { return _M_len; } size() const noexcept { return _M_len; }
// First element. // First element.
constexpr const_iterator constexpr const_iterator
begin() { return _M_array; } begin() const noexcept { return _M_array; }
// One past the last element. // One past the last element.
constexpr const_iterator constexpr const_iterator
end() { return begin() + size(); } end() const noexcept { return begin() + size(); }
}; };
/** /**
...@@ -83,7 +84,7 @@ namespace std ...@@ -83,7 +84,7 @@ namespace std
*/ */
template<class _Tp> template<class _Tp>
constexpr const _Tp* constexpr const _Tp*
begin(initializer_list<_Tp> __ils) begin(initializer_list<_Tp> __ils) noexcept
{ return __ils.begin(); } { return __ils.begin(); }
/** /**
...@@ -93,7 +94,7 @@ namespace std ...@@ -93,7 +94,7 @@ namespace std
*/ */
template<class _Tp> template<class _Tp>
constexpr const _Tp* constexpr const _Tp*
end(initializer_list<_Tp> __ils) end(initializer_list<_Tp> __ils) noexcept
{ return __ils.end(); } { return __ils.end(); }
} }
......
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