diff --git a/include/future b/include/future index 48550a37e..99c70fbef 100644 --- a/include/future +++ b/include/future @@ -156,7 +156,7 @@ public: ~future(); future& operator=(const future& rhs) = delete; future& operator=(future&&) noexcept; - shared_future share(); + shared_future share() noecept; // retrieving the value R get(); @@ -183,7 +183,7 @@ public: ~future(); future& operator=(const future& rhs) = delete; future& operator=(future&&) noexcept; - shared_future share(); + shared_future share() noexcept; // retrieving the value R& get(); @@ -210,7 +210,7 @@ public: ~future(); future& operator=(const future& rhs) = delete; future& operator=(future&&) noexcept; - shared_future share(); + shared_future share() noexcept; // retrieving the value void get(); @@ -1119,7 +1119,7 @@ public: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~future(); _LIBCPP_INLINE_VISIBILITY - shared_future<_Rp> share(); + shared_future<_Rp> share() _NOEXCEPT; // retrieving the value _Rp get(); @@ -1222,7 +1222,7 @@ public: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~future(); _LIBCPP_INLINE_VISIBILITY - shared_future<_Rp&> share(); + shared_future<_Rp&> share() _NOEXCEPT; // retrieving the value _Rp& get(); @@ -1320,7 +1320,7 @@ public: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES ~future(); _LIBCPP_INLINE_VISIBILITY - shared_future share(); + shared_future share() _NOEXCEPT; // retrieving the value void get(); @@ -2580,7 +2580,7 @@ swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) _NOEXCEPT template inline shared_future<_Rp> -future<_Rp>::share() +future<_Rp>::share() _NOEXCEPT { return shared_future<_Rp>(_VSTD::move(*this)); } @@ -2588,7 +2588,7 @@ future<_Rp>::share() template inline shared_future<_Rp&> -future<_Rp&>::share() +future<_Rp&>::share() _NOEXCEPT { return shared_future<_Rp&>(_VSTD::move(*this)); } @@ -2597,7 +2597,7 @@ future<_Rp&>::share() inline shared_future -future::share() +future::share() _NOEXCEPT { return shared_future(_VSTD::move(*this)); } diff --git a/test/std/thread/futures/futures.unique_future/share.pass.cpp b/test/std/thread/futures/futures.unique_future/share.pass.cpp index ef011d8df..2e4c332f2 100644 --- a/test/std/thread/futures/futures.unique_future/share.pass.cpp +++ b/test/std/thread/futures/futures.unique_future/share.pass.cpp @@ -25,6 +25,7 @@ int main() typedef int T; std::promise p; std::future f0 = p.get_future(); + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(f.valid()); @@ -32,6 +33,7 @@ int main() { typedef int T; std::future f0; + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(!f.valid()); @@ -40,6 +42,7 @@ int main() typedef int& T; std::promise p; std::future f0 = p.get_future(); + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(f.valid()); @@ -47,6 +50,7 @@ int main() { typedef int& T; std::future f0; + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(!f.valid()); @@ -55,6 +59,7 @@ int main() typedef void T; std::promise p; std::future f0 = p.get_future(); + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(f.valid()); @@ -62,6 +67,7 @@ int main() { typedef void T; std::future f0; + static_assert( noexcept(f0.share()), ""); std::shared_future f = std::move(f0.share()); assert(!f0.valid()); assert(!f.valid()); diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index ce36bf556..55d93da54 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -356,7 +356,7 @@ 2540unordered_multimap::insert hint iteratorIssaquahComplete 2543LWG 2148 (hash support for enum types) seems under-specifiedIssaquahComplete 2544istreambuf_iterator(basic_streambuf* s) effects unclear when s is 0IssaquahComplete - 2556Wide contract for future::share()IssaquahPatch ready + 2556Wide contract for future::share()IssaquahComplete 2562Consistent total ordering of pointers by comparison functorsIssaquah 2567Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraitsIssaquahComplete 2568[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraitsIssaquah