forked from boostorg/smart_ptr
Update make_shared for arrays to address 2070
This updates make_shared and allocate_shared for arrays in accordance with report 2070 which requires that allocator_traits<A2>::construct(a2, ptr, ...) is used for construction and allocator_traits<A2>::destroy(a2, ptr) is used for destruction instead of placement new and destructor invocation.
This commit is contained in:
@@ -56,8 +56,6 @@ template<typename U>
|
||||
<code>r</code> is the return value.</p>
|
||||
<p><b>Throws:</b> <code>bad_alloc</code>, or an exception thrown from
|
||||
the initialization of the object.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Remarks:</b></p>
|
||||
<blockquote>
|
||||
<p>When an object of a non-array type <code>T</code> is specified to
|
||||
@@ -82,8 +80,6 @@ unique_ptr<U> make_unique(Args&&... args);</pre>
|
||||
initialized to <code>U(forward<Args>(args)...)</code>.</p>
|
||||
<p><b>Remarks:</b> This overload shall only participate in overload
|
||||
resolution when <code>U</code> is not an array type.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Examples:</b></p>
|
||||
<blockquote>
|
||||
<pre>unique_ptr<float> p1 = boost::make_unique<float>();
|
||||
@@ -97,8 +93,6 @@ unique_ptr<U> make_unique(U&& value);</pre>
|
||||
initialized to <code>move(value)</code>.</p>
|
||||
<p><b>Remarks:</b> This overload shall only participate in overload
|
||||
resolution when <code>U</code> is not an array type.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Examples:</b></p>
|
||||
<blockquote>
|
||||
<pre>unique_ptr<string> p1 = boost::make_unique<string>({'a', 'b'});
|
||||
@@ -112,8 +106,6 @@ unique_ptr<U> make_unique(size_t size);</pre>
|
||||
<code>T[size]</code>.</p>
|
||||
<p><b>Remarks:</b> This overload shall only participate in overload
|
||||
resolution when <code>U</code> is of the form <code>T[]</code>.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Examples:</b></p>
|
||||
<blockquote>
|
||||
<pre>unique_ptr<double[]> p1 = boost::make_unique<double[]>(4);
|
||||
@@ -127,8 +119,6 @@ unique_ptr<U> make_unique_noinit();</pre>
|
||||
type <code>U</code>.</p>
|
||||
<p><b>Remarks:</b> This overload shall only participate in overload
|
||||
resolution when <code>U</code> is not an array type.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Examples:</b></p>
|
||||
<blockquote>
|
||||
<pre>unique_ptr<float> p1 = boost::make_unique_noinit<float>();
|
||||
@@ -142,8 +132,6 @@ unique_ptr<U> make_unique_noinit(size_t size);</pre>
|
||||
type <code>T[size]</code>.</p>
|
||||
<p><b>Remarks:</b> This overload shall only participate in overload
|
||||
resolution when <code>U</code> is of the form <code>T[]</code>.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p><b>Examples:</b></p>
|
||||
<blockquote>
|
||||
<pre>unique_ptr<double[]> p1 = boost::make_unique_noinit<double[]>(4);
|
||||
|
||||
Reference in New Issue
Block a user