mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-07-10 02:11:11 +02:00
Add final overload of make_shared and allocate_shared (array forms) for T[][N] with C++11 initializer lists.
[SVN r81275]
This commit is contained in:
+12
-6
@@ -49,16 +49,22 @@
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[]> <a href="#functions">make_shared</a>(std::initializer_list<T> list);
|
||||
shared_ptr<T[]> <a href="#functions">make_shared</a>(initializer_list<T> list);
|
||||
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">make_shared</a>(std::initializer_list<T> list);
|
||||
shared_ptr<T[N]> <a href="#functions">make_shared</a>(initializer_list<T> list);
|
||||
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[][N]> <a href="#functions">make_shared</a>(size_t size, initializer_list<T> list);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[]> <a href="#functions">allocate_shared</a>(const A& allocator, std::initializer_list<T> list);
|
||||
shared_ptr<T[]> <a href="#functions">allocate_shared</a>(const A& allocator, initializer_list<T> list);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">allocate_shared</a>(const A& allocator, std::initializer_list<T> list);
|
||||
shared_ptr<T[N]> <a href="#functions">allocate_shared</a>(const A& allocator, initializer_list<T> list);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[][N]> <a href="#functions">allocate_shared</a>(const A& allocator, size_t size, initializer_list<T> list);
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
@@ -74,7 +80,7 @@ template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T> allocate_shared(const A& allocator, size_t size, Args&&... args);</pre>
|
||||
<blockquote>
|
||||
<p><b>Requires:</b> The expression
|
||||
<code>new(pointer) T(std::forward<Args>(args)...)</code>, where
|
||||
<code>new(pointer) T(forward<Args>(args)...)</code>, where
|
||||
<code>pointer</code> is a <code>void*</code> pointing to storage
|
||||
suitable to hold an object of type <code>T</code>, shall be
|
||||
well-formed. <code>A</code> shall be an <em>Allocator</em>, as
|
||||
@@ -85,7 +91,7 @@ template<typename T, typename A, typename... Args>
|
||||
<code>T</code> and size <code>size</code> and constructs an array
|
||||
of objects in it via the placement new expression
|
||||
<code>new(pointer) T()</code> or
|
||||
<code>new(pointer) T(std::forward<Args>(args)...)</code>.
|
||||
<code>new(pointer) T(forward<Args>(args)...)</code>.
|
||||
<code>allocate_shared</code> uses a copy of
|
||||
<code>allocator</code> to allocate memory. If an exception is thrown,
|
||||
has no effect.</p>
|
||||
|
||||
Reference in New Issue
Block a user