Make std::future::share() noexcept (LWG 2556)

* include/std/future (future::share(), future<R&>::share())
	(future<void>::share()): Add noexcept, as per LWG 2556.

From-SVN: r242374
This commit is contained in:
Jonathan Wakely 2016-11-14 03:44:53 +00:00 committed by Jonathan Wakely
parent 881ca4c9de
commit 9c52cc0189
2 changed files with 13 additions and 6 deletions

View File

@ -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

View File

@ -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