diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-14 03:44:53 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-11-14 03:44:53 +0000 |
commit | d5c8ced6b10231cb8c2c634a83776e21735f6820 (patch) | |
tree | 4cfc5ad0f9a7a0b995b8f9c7d2d96da6485c2570 /libstdc++-v3 | |
parent | 682d2b7ee96c90d77f37c187b7d247c379074157 (diff) | |
download | gcc-d5c8ced6b10231cb8c2c634a83776e21735f6820.tar.gz |
Make std::future::share() noexcept (LWG 2556)
* include/std/future (future::share(), future<R&>::share())
(future<void>::share()): Add noexcept, as per LWG 2556.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242374 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/future | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c8cbb2c29f7..71af4dc8d57 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2016-11-14 Jonathan Wakely <jwakely@redhat.com> + + * include/std/future (future::share(), future<R&>::share()) + (future<void>::share()): Add noexcept, as per LWG 2556. + 2016-11-13 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/78326 diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index cb42830aa9c..8ba13069510 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -778,7 +778,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return std::move(this->_M_get_result()._M_value()); } - shared_future<_Res> share(); + shared_future<_Res> share() noexcept; }; /// Partial specialization for future<R&> @@ -821,7 +821,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return this->_M_get_result()._M_get(); } - shared_future<_Res&> share(); + shared_future<_Res&> share() noexcept; }; /// Explicit specialization for future<void> @@ -864,7 +864,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION this->_M_get_result(); } - shared_future<void> share(); + shared_future<void> share() noexcept; }; @@ -1004,18 +1004,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _M_state(std::move(__uf._M_state)) { } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2556. Wide contract for future::share() template<typename _Res> inline shared_future<_Res> - future<_Res>::share() + future<_Res>::share() noexcept { return shared_future<_Res>(std::move(*this)); } template<typename _Res> inline shared_future<_Res&> - future<_Res&>::share() + future<_Res&>::share() noexcept { return shared_future<_Res&>(std::move(*this)); } inline shared_future<void> - future<void>::share() + future<void>::share() noexcept { return shared_future<void>(std::move(*this)); } /// Primary template for promise |