diff mbox series

Add noexcept to std::shared_future copy operations (LWG DR 2799)

Message ID 20171116144039.GA15513@redhat.com
State New
Headers show
Series Add noexcept to std::shared_future copy operations (LWG DR 2799) | expand

Commit Message

Jonathan Wakely Nov. 16, 2017, 2:40 p.m. UTC
These functions just increment a refcount (and the base class
functions that do that are already noexcept anyway).

	* include/std/future (shared_future): Add noexcept to copy constructor
	and copy-assignment operator (LWG 2799).

Tested pwoerpc64le-linux, committed to trunk.
commit 9b66ab2fb36324e2d9cb8e99207d08d531c5cec3
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 16 14:24:02 2017 +0000

    Add noexcept to std::shared_future copy operations (LWG DR 2799)
    
            * include/std/future (shared_future): Add noexcept to copy constructor
            and copy-assignment operator (LWG 2799).
diff mbox series

Patch

diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index 73d5a60a918..d9d446bc2f6 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -896,7 +896,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
       constexpr shared_future() noexcept : _Base_type() { }
 
       /// Copy constructor
-      shared_future(const shared_future& __sf) : _Base_type(__sf) { }
+      shared_future(const shared_future& __sf) noexcept : _Base_type(__sf) { }
 
       /// Construct from a future rvalue
       shared_future(future<_Res>&& __uf) noexcept
@@ -908,7 +908,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
       : _Base_type(std::move(__sf))
       { }
 
-      shared_future& operator=(const shared_future& __sf)
+      shared_future& operator=(const shared_future& __sf) noexcept
       {
         shared_future(__sf)._M_swap(*this);
         return *this;