You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
otherwise, <code>Y*</code> shall be convertible to <code>T*</code>.</cxx-requires>
362
362
363
363
<cxx-effects>When <code>T</code> is not an array type, constructs a <code>shared_ptr</code> object that <i>owns</i> the pointer <code>p</code>.
364
-
Otherwise, constructs a <code>shared_ptr</code> that <em>owns</em><code>p</code> and a deleter of an unspecified type that calls <code>delete[] p</code>.</cxx-effects>
364
+
Otherwise, constructs a <code>shared_ptr</code> that <em>owns</em><code>p</code> and a deleter of an unspecified type that calls <code>delete[] p</code>.
365
+
If an exception is thrown, <code>delete p</code> is called when <code>T</code> is not an array type, <code>delete[] p</code> otherwise.</cxx-effects>
<cxx-throws><code>bad_alloc</code>, or an implementation-defined exception when a resource other than memory could not be obtained.</cxx-throws>
369
-
370
-
<cxx-exception-safety>If an exception is thrown, <code>delete p</code> is called when <code>T</code> is not an array type, <code>delete[] p</code> otherwise.</cxx-exception-safety>
when <code>T</code> is <code>U[]</code>, <code>Y(*)[]</code> shall be convertible to <code>T*</code>;
382
381
otherwise, <code>Y*</code> shall be convertible to <code>T*</code>.</cxx-requires>
383
382
384
-
<cxx-effects>Constructs a <code>shared_ptr</code> object that <i>owns</i> the object <code>p</code> and the deleter <code>d</code>. The second and fourth constructors shall use a copy of <code>a</code> to allocate memory for internal use.</cxx-effects>
383
+
<cxx-effects>Constructs a <code>shared_ptr</code> object that <i>owns</i> the object <code>p</code> and the deleter <code>d</code>. The second and fourth constructors shall use a copy of <code>a</code> to allocate memory for internal use. If an exception is thrown, <code>d(p)</code> is called.</cxx-effects>
<cxx-requires><code>Y*</code> shall be <i>compatible with</i><code>T*</code>.</cxx-requires>
436
433
437
-
<cxx-effects>Constructs a <code>shared_ptr</code> object that <i>shares ownership</i> with <code>r</code> and stores a copy of the pointer stored in <code>r</code>.</cxx-effects>
434
+
<cxx-effects>Constructs a <code>shared_ptr</code> object that <i>shares ownership</i> with <code>r</code> and stores a copy of the pointer stored in <code>r</code>. If an exception is thrown, the constructor has no effect.</cxx-effects>
<cxx-throws><code>bad_weak_ptr</code> when <code>r.expired()</code>.</cxx-throws>
442
-
443
-
<cxx-exception-safety>If an exception is thrown, the constructor has no effect.</cxx-exception-safety>
444
439
</cxx-function>
445
440
446
441
<cxx-function>
447
442
<cxx-signature>template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);</cxx-signature>
448
443
449
444
<cxx-remarks>This constructor shall not participate in overload resolution unless <code>Y*</code> is <em>compatible with</em><code>T*</code>.</cxx-remarks>
450
445
451
-
<cxx-effects>Equivalent to <code>shared_ptr(r.release(), r.get_deleter())</code> when <code>D</code> is not a reference type, otherwise <code>shared_ptr(r.release(), ref(r.get_deleter()))</code>.</cxx-effects>
452
-
453
-
<cxx-exception-safety>If an exception is thrown, the constructor has no effect.</cxx-exception-safety>
446
+
<cxx-effects>Equivalent to <code>shared_ptr(r.release(), r.get_deleter())</code> when <code>D</code> is not a reference type, otherwise <code>shared_ptr(r.release(), ref(r.get_deleter()))</code>. If an exception is thrown, the constructor has no effect.</cxx-effects>
0 commit comments