Make std::future::share() noexcept (LWG 2556)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 14 Nov 2016 03:44:53 +0000 (03:44 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Nov 2016 03:44:53 +0000 (03:44 +0000)
* include/std/future (future::share(), future<R&>::share())
(future<void>::share()): Add noexcept, as per LWG 2556.

From-SVN: r242374

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/future

index c8cbb2c29f77a2717e956107e91012c87e3b76c1..71af4dc8d57b98bd8f3efb1d9d81418b698fee41 100644 (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
index cb42830aa9cb72081ee443fb352cbafc23176b8d..8ba130695108b0d375f4a6956c9edb19e93185e8 100644 (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