This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.
Section: 8.2.1.1 [fund.ts.v2::memory.smartptr.shared.const] Status: TS Submitter: Daniel Krügler Opened: 2015-10-24 Last modified: 2017-07-30
Priority: 0
View all issues with TS status.
Discussion:
Addresses: fund.ts.v2
Similar to LWG 2495(i), the current library fundamentals working paper refers to several "Exception safety" elements without providing a definition for this element type.
Proposed resolution:
This wording is relative to N4529.
Change 8.2.1.1 [fund.ts.v2::memory.smartptr.shared.const] as indicated:
template<class Y> explicit shared_ptr(Y* p);[…]
-3- Effects: WhenTis not an array type, constructs ashared_ptrobject that owns the pointerp. Otherwise, constructs ashared_ptrthat ownspand a deleter of an unspecified type that callsdelete[] p. If an exception is thrown,delete pis called whenTis not an array type,delete[] potherwise. […]-6- Exception safety: If an exception is thrown,delete pis called whenTis not an array type,delete[] potherwise.template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);[…]
-9- Effects: Constructs ashared_ptrobject that owns the objectpand the deleterd. The second and fourth constructors shall use a copy ofato allocate memory for internal use. If an exception is thrown,d(p)is called. […]-12- Exception safety: If an exception is thrown,d(p)is called.[…]
template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);[…]
-28- Effects: Constructs ashared_ptrobject that shares ownership withrand stores a copy of the pointer stored inr. If an exception is thrown, the constructor has no effect. […]-31- Exception safety: If an exception is thrown, the constructor has no effect.template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);[…]
-34- Effects: Equivalent toshared_ptr(r.release(), r.get_deleter())whenDis not a reference type, otherwiseshared_ptr(r.release(), ref(r.get_deleter())). If an exception is thrown, the constructor has no effect.-35- Exception safety: If an exception is thrown, the constructor has no effect.