forked from boostorg/smart_ptr
Merged revision(s) 81641-81643,81658,81669,81681 from trunk:
Use const T (&)[N] for fixed size arrays instead of std::initializer<T> in overloads of make_shared and allocate_shared for arrays. ........ Use BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead for certain overloads of make_shared and allocate_shared ........ Code consistency: Use the same style of #if conditional compilation checks in allocate_shared_array.hpp and make_shared_array.hpp. ........ Change make_shared and allocate_shared array form overload for size and inner array initialization list to use const T(&)[N] instead of std::initializer_list<T>. ........ Move two tests for allocate_shared and make_shared within check for BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX ........ Make specializations of detail array_deleter consistent. ........ [SVN r81682]
This commit is contained in:
+23
-21
@@ -12,7 +12,7 @@
|
||||
<A href="#Synopsis">Synopsis</A><br>
|
||||
<A href="#functions">Free Functions</A><br>
|
||||
<A href="#example">Example</A><br>
|
||||
<A href="#history">History</A><br>
|
||||
<A href="#history">History</A><br></p>
|
||||
<h2><a name="Introduction">Introduction</a></h2>
|
||||
<p>Originally the Boost function templates <code>make_shared</code> and
|
||||
<code>allocate_shared</code> were for efficient allocation of single
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
template<typename T, typename A>
|
||||
shared_ptr<T[]> <a href="#functions">allocate_shared</a>(const A& allocator, size_t size);
|
||||
|
||||
|
||||
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[]> <a href="#functions">make_shared</a>(size_t size, Args&&... args);
|
||||
@@ -48,31 +48,33 @@
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">allocate_shared</a>(const A& allocator, Args&&... args);
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
template<typename T, typename... Args>
|
||||
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>(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... Args>
|
||||
shared_ptr<T[M][N]> <a href="#functions">make_shared</a>(initializer_list<T> list);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[]> <a href="#functions">allocate_shared</a>(const A& allocator, initializer_list<T> list);
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">make_shared</a>(const T (&list)[N]);
|
||||
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[][N]> <a href="#functions">make_shared</a>(size_t size, const T (&list)[N]);
|
||||
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[M][N]> <a href="#functions">make_shared</a>(const T (&list)[N]);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">allocate_shared</a>(const A& allocator, initializer_list<T> list);
|
||||
shared_ptr<T[N]> <a href="#functions">allocate_shared</a>(const A& allocator, const T (&list)[N]);
|
||||
|
||||
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);
|
||||
shared_ptr<T[][N]> <a href="#functions">allocate_shared</a>(const A& allocator, size_t size, const T (&list)[N]);
|
||||
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[M][N]> <a href="#functions">allocate_shared</a>(const A& allocator, initializer_list<T> list);
|
||||
shared_ptr<T[M][N]> <a href="#functions">allocate_shared</a>(const A& allocator, const T (&list)[N]);
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
@@ -141,25 +143,25 @@ template<typename T, typename A, typename... Args>
|
||||
from the initializer list.</p>
|
||||
</blockquote>
|
||||
<pre>template<typename T, typename... Args>
|
||||
shared_ptr<T[N]> make_shared(initializer_list<T> list);
|
||||
shared_ptr<T[N]> make_shared(const T (&list)[N]);
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[N]> allocate_shared(const A& allocator, initializer_list<T> list);</pre>
|
||||
shared_ptr<T[N]> allocate_shared(const A& allocator, const T (&list)[N]);</pre>
|
||||
<blockquote>
|
||||
<p><b>Description:</b> These overloads of the utilities above are for a
|
||||
fixed size array.</p>
|
||||
</blockquote>
|
||||
<pre>template<typename T, typename... Args>
|
||||
shared_ptr<T[][N]> make_shared(size_t size, initializer_list<T> list);
|
||||
shared_ptr<T[][N]> make_shared(size_t size, const T (&list)[N]);
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, initializer_list<T> list);</pre>
|
||||
shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);</pre>
|
||||
<blockquote>
|
||||
<p><b>Description:</b> These overloads initialize inner array elements
|
||||
from the initializer list.</p>
|
||||
</blockquote>
|
||||
<pre>template<typename T, typename... Args>
|
||||
shared_ptr<T[M][N]> make_shared(initializer_list<T> list);
|
||||
shared_ptr<T[M][N]> make_shared(const T (&list)[N]);
|
||||
template<typename T, typename A, typename... Args>
|
||||
shared_ptr<T[M][N]> allocate_shared(const A& allocator, initializer_list<T> list);</pre>
|
||||
shared_ptr<T[M][N]> allocate_shared(const A& allocator, const T (&list)[N]);</pre>
|
||||
<blockquote>
|
||||
<p><b>Description:</b> These overloads of the utilities above are for a
|
||||
fixed size array.</p>
|
||||
|
||||
Reference in New Issue
Block a user