diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-11-01 19:11:47 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-11-03 00:16:01 +0000 |
commit | 4f032929ac9e549ade45c952505ef562b82d297e (patch) | |
tree | f267ecbcaa4f69c20bcbc2dd5123e34fee89a641 | |
parent | 1fefb6cf62b7411223a5459af40e6b98e3624535 (diff) | |
download | gcc-4f032929ac9e549ade45c952505ef562b82d297e.zip gcc-4f032929ac9e549ade45c952505ef562b82d297e.tar.gz gcc-4f032929ac9e549ade45c952505ef562b82d297e.tar.bz2 |
libstdc++: Add some noexcept to std::valarray
libstdc++-v3/ChangeLog:
* include/std/valarray (valarray::valarray()): Add noexcept.
(valarray::operator[]): Likewise.
-rw-r--r-- | libstdc++-v3/include/std/valarray | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray index c6242eb..9c2f1be 100644 --- a/libstdc++-v3/include/std/valarray +++ b/libstdc++-v3/include/std/valarray @@ -137,7 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _lib.valarray.cons_ construct/destroy: /// Construct an empty array. - valarray(); + valarray() _GLIBCXX_NOTHROW; /// Construct an array with @a n elements. explicit valarray(size_t); @@ -270,11 +270,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @param __i Index of element to return. * @return Reference to the i'th element. */ - _Tp& operator[](size_t __i); + _Tp& operator[](size_t __i) _GLIBCXX_NOTHROW; // _GLIBCXX_RESOLVE_LIB_DEFECTS // 389. Const overload of valarray::operator[] returns by value. - const _Tp& operator[](size_t) const; + const _Tp& operator[](size_t) const _GLIBCXX_NOTHROW; // _lib.valarray.sub_ subset operations: /** @@ -581,7 +581,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> inline const _Tp& - valarray<_Tp>::operator[](size_t __i) const + valarray<_Tp>::operator[](size_t __i) const _GLIBCXX_NOTHROW { __glibcxx_requires_subscript(__i); return _M_data[__i]; @@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> inline _Tp& - valarray<_Tp>::operator[](size_t __i) + valarray<_Tp>::operator[](size_t __i) _GLIBCXX_NOTHROW { __glibcxx_requires_subscript(__i); return _M_data[__i]; @@ -618,7 +618,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> inline - valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {} + valarray<_Tp>::valarray() _GLIBCXX_NOTHROW : _M_size(0), _M_data(0) {} template<typename _Tp> inline |