diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-11-15 17:50:42 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-11-15 17:50:42 +0000 |
commit | 1949122881af310b7b0177105d515d62e59a630b (patch) | |
tree | 2d3a6da42eaa4bb8425adfc325cbd0a444de3b0d /libstdc++-v3 | |
parent | bd9cc42bb85bef57fb5ae6639599966c3b0468b6 (diff) | |
download | gcc-1949122881af310b7b0177105d515d62e59a630b.zip gcc-1949122881af310b7b0177105d515d62e59a630b.tar.gz gcc-1949122881af310b7b0177105d515d62e59a630b.tar.bz2 |
Add noexcept to generic std::size, std::empty and std::data
* include/bits/range_access.h (size, empty, data): Add conditional
noexcept to generic overloads.
From-SVN: r254779
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/range_access.h | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dc152b3..5f0bcca 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2017-11-15 Jonathan Wakely <jwakely@redhat.com> + + * include/bits/range_access.h (size, empty, data): Add conditional + noexcept to generic overloads. + 2017-11-14 Ville Voutilainen <ville.voutilainen@gmail.com> Implement LWG 2733 and LWG 2759 diff --git a/libstdc++-v3/include/bits/range_access.h b/libstdc++-v3/include/bits/range_access.h index 3987c2a..2a037ad 100644 --- a/libstdc++-v3/include/bits/range_access.h +++ b/libstdc++-v3/include/bits/range_access.h @@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // C++14 -#if __cplusplus > 201402L +#if __cplusplus >= 201703L #define __cpp_lib_nonmember_container_access 201411 /** @@ -239,7 +239,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template <typename _Container> constexpr auto - size(const _Container& __cont) -> decltype(__cont.size()) + size(const _Container& __cont) noexcept(noexcept(__cont.size())) + -> decltype(__cont.size()) { return __cont.size(); } /** @@ -257,7 +258,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template <typename _Container> constexpr auto - empty(const _Container& __cont) -> decltype(__cont.empty()) + empty(const _Container& __cont) noexcept(noexcept(__cont.empty())) + -> decltype(__cont.empty()) { return __cont.empty(); } /** @@ -284,7 +286,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template <typename _Container> constexpr auto - data(_Container& __cont) -> decltype(__cont.data()) + data(_Container& __cont) noexcept(noexcept(__cont.data())) + -> decltype(__cont.data()) { return __cont.data(); } /** @@ -293,7 +296,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template <typename _Container> constexpr auto - data(const _Container& __cont) -> decltype(__cont.data()) + data(const _Container& __cont) noexcept(noexcept(__cont.data())) + -> decltype(__cont.data()) { return __cont.data(); } /** |