OSDN Git Service

Mark shared_ptr::__create_with_control_block as noexcept.
authorzoecarver <z.zoelec2@gmail.com>
Wed, 20 May 2020 00:17:16 +0000 (17:17 -0700)
committerzoecarver <z.zoelec2@gmail.com>
Wed, 20 May 2020 00:17:16 +0000 (17:17 -0700)
Summary: The default constructor for shared_ptr and shared_ptr::__enable_weak_this are both noexcept so, shared_ptr::__create_with_control_block can also be marked noexcept.

Reviewers: ldionne, #libc!

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D80070

libcxx/include/memory

index 4962714..af9230c 100644 (file)
@@ -3954,7 +3954,7 @@ public:
 
     template<class _Yp, class _CntrlBlk>
     static shared_ptr<_Tp>
-    __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl)
+    __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT
     {
         shared_ptr<_Tp> __r;
         __r.__ptr_ = __p;