_LIBCPP_INLINE_VISIBILITY
shared_future() _NOEXCEPT : __state_(nullptr) {}
_LIBCPP_INLINE_VISIBILITY
- shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
+ shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
{__rhs.__state_ = nullptr;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
- shared_future& operator=(const shared_future& __rhs);
+ shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
template <class _Rp>
shared_future<_Rp>&
-shared_future<_Rp>::operator=(const shared_future& __rhs)
+shared_future<_Rp>::operator=(const shared_future& __rhs) _NOEXCEPT
{
if (__rhs.__state_)
__rhs.__state_->__add_shared();
// class shared_future<R>
// shared_future& operator=(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f;
f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(f = f0), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
// class shared_future<R>
// shared_future(const shared_future& rhs);
+// noexcept in C++17
#include <future>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
std::promise<T> p;
std::shared_future<T> f0 = p.get_future();
std::shared_future<T> f = f0;
+#if TEST_STD_VER > 14
+ static_assert(noexcept(std::shared_future<T>{f0}), "" );
+#endif
assert(f0.valid());
assert(f.valid());
}
<tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0510R0">P0510R0</a></td><td>LWG</td><td>Disallowing references, incomplete types, arrays, and empty variants</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0513R0">P0513R0</a></td><td>LWG</td><td>Poisoning the Hash</td><td>Issaquah</td><td></td><td></td></tr>
- <tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_future’s Copy Operations have Wide Contracts</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_future’s Copy Operations have Wide Contracts</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td></td><td></td></tr>