|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83827 - trunk/libs/smart_ptr
From: glenfe_at_[hidden]
Date: 2013-04-10 01:00:52
Author: glenfe
Date: 2013-04-10 01:00:52 EDT (Wed, 10 Apr 2013)
New Revision: 83827
URL: http://svn.boost.org/trac/boost/changeset/83827
Log:
Small improvements to make_shared documentation.
Text files modified:
trunk/libs/smart_ptr/make_shared_array.html | 186 ++++++++++++++++++++--------------------
1 files changed, 93 insertions(+), 93 deletions(-)
Modified: trunk/libs/smart_ptr/make_shared_array.html
==============================================================================
--- trunk/libs/smart_ptr/make_shared_array.html (original)
+++ trunk/libs/smart_ptr/make_shared_array.html 2013-04-10 01:00:52 EDT (Wed, 10 Apr 2013)
@@ -29,85 +29,85 @@
allowing finer control.</p>
<h2><a name="Synopsis">Synopsis</a></h2>
<pre>namespace boost {
- template<typename T>
- shared_ptr<T[]> make_shared(size_t size);
+ template<typename U> // U = T[]
+ shared_ptr<U> make_shared(size_t size);
- template<typename T, typename A>
- shared_ptr<T[]> allocate_shared(const A& allocator, size_t size);
-
-#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- template<typename T, typename... Args>
- shared_ptr<T[]> make_shared(size_t size, Args&&... args);
+ template<typename U, typename A> // U = T[]
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size);
- template<typename T, typename... Args>
- shared_ptr<T[N]> make_shared(Args&&... args);
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template<typename U, typename... Args> // U = T[]
+ shared_ptr<U> make_shared(size_t size, Args&&... args);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[]> allocate_shared(const A& allocator, size_t size, Args&&... args);
+ template<typename U, typename... Args> // U = T[N]
+ shared_ptr<U> make_shared(Args&&... args);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[N]> allocate_shared(const A& allocator, Args&&... args);
+ template<typename U, typename A, typename... Args> // U = T[]
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size, Args&&... args);
+
+ template<typename U, typename A, typename... Args> // U = T[N]
+ shared_ptr<U> allocate_shared(const A& allocator, Args&&... args);
#endif
-
-#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
- template<typename T, typename... Args>
- shared_ptr<T[N]> make_shared(const T (&list)[N]);
- template<typename T, typename... Args>
- shared_ptr<T[][N]> make_shared(size_t size, const T (&list)[N]);
+#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
+ template<typename U, typename... Args> // U = T[N]
+ shared_ptr<U> make_shared(const T (&list)[N]);
+
+ template<typename U, typename... Args> // U = T[][N]
+ shared_ptr<U> make_shared(size_t size, const T (&list)[N]);
- template<typename T, typename... Args>
- shared_ptr<T[M][N]> make_shared(const T (&list)[N]);
+ template<typename U, typename... Args> // U = T[M][N]
+ shared_ptr<U> make_shared(const T (&list)[N]);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[N]> allocate_shared(const A& allocator, const T (&list)[N]);
+ template<typename U, typename A, typename... Args> // U = T[N]
+ shared_ptr<T[> allocate_shared(const A& allocator, const T (&list)[N]);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);
+ template<typename U, typename A, typename... Args> // U = T[][N]
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[M][N]> allocate_shared(const A& allocator, const T (&list)[N]);
+ template<typename U, typename A, typename... Args> // U = T[M][N]
+ shared_ptr<U> allocate_shared(const A& allocator, const T (&list)[N]);
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- template<typename T, typename... Args>
- shared_ptr<T[]> make_shared(initializer_list<T> list);
+ template<typename U, typename... Args> // U = T[]
+ shared_ptr<U> make_shared(initializer_list<T> list);
- template<typename T, typename A, typename... Args>
- shared_ptr<T[]> allocate_shared(const A& allocator, initializer_list<T> list);
+ template<typename U, typename A, typename... Args> // U = T[]
+ shared_ptr<U> allocate_shared(const A& allocator, initializer_list<T> list);
#endif
-#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- template<typename T>
- shared_ptr<T[]> make_shared(size_t size, T&& value);
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template<typename U> // U = T[]
+ shared_ptr<U> make_shared(size_t size, T&& value);
- template<typename T>
- shared_ptr<T[N]> make_shared(T&& value);
+ template<typename U> // U = T[N]
+ shared_ptr<U> make_shared(T&& value);
- template<typename T, typename A>
- shared_ptr<T[]> allocate_shared(const A& allocator, size_t size, T&& value);
+ template<typename U, typename A> // U = T[]
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size, T&& value);
- template<typename T, typename A>
- shared_ptr<T[N]> allocate_shared(const A& allocator, T&& value);
+ template<typename U, typename A> // U = T[N]
+ shared_ptr<U> allocate_shared(const A& allocator, T&& value);
#endif
#endif
- template<typename T>
- shared_ptr<T[]> make_shared_noinit(size_t size);
+ template<typename U> // U = T[]
+ shared_ptr<U> make_shared_noinit(size_t size);
+
+ template<typename U> // U = T[N]
+ shared_ptr<U> make_shared_noinit();
- template<typename T>
- shared_ptr<T[N]> make_shared_noinit();
-
- template<typename T, typename A>
- shared_ptr<T[]> allocate_shared_noinit(const A& allocator, size_t size);
+ template<typename U, typename A> // U = T[]
+ shared_ptr<U> allocate_shared_noinit(const A& allocator, size_t size);
- template<typename T, typename A>
- shared_ptr<T[N]> allocate_shared_noinit(const A& allocator);
+ template<typename U, typename A> // U = T[N]
+ shared_ptr<U> allocate_shared_noinit(const A& allocator);
}</pre>
<h2><a name="functions">Free Functions</a></h2>
- <pre>template<typename T, typename... Args>
- shared_ptr<T[]> make_shared(size_t size, Args&&... args);
-template<typename T, typename A, typename... Args>
- shared_ptr<T[]> allocate_shared(const A& allocator, size_t size, Args&&... args);</pre>
+ <pre>template<typename U, typename... Args>
+ shared_ptr<U> make_shared(size_t size, Args&&... args);
+template<typename U, typename A, typename... Args>
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size, Args&&... args);</pre>
<blockquote>
<p><b>Requires:</b> The expression
<code>new(pointer) T(forward<Args>(args)...)</code>, where
@@ -121,7 +121,7 @@
<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(forward<Args>(args)...)</code>.
+ <code>new(pointer) T(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>
@@ -146,74 +146,74 @@
take any constructor arguments. These overloads invoke the default
constructor of <code>T</code> for each array element.</p>
</blockquote>
- <pre>template<typename T, typename... Args>
- shared_ptr<T[N]> make_shared(Args&&... args);
-template<typename T, typename A, typename... Args>
- shared_ptr<T[N]> allocate_shared(const A& allocator, Args&&... args);</pre>
+ <pre>template<typename U, typename... Args>
+ shared_ptr<U> make_shared(Args&&... args);
+template<typename U, typename A, typename... Args>
+ shared_ptr<U> allocate_shared(const A& allocator, Args&&... args);</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[]> make_shared(initializer_list<T> list);
-template<typename T, typename A, typename... Args>
- shared_ptr<T[]> allocate_shared(const A& allocator, initializer_list<T> list);</pre>
+ <pre>template<typename U, typename... Args>
+ shared_ptr<U> make_shared(initializer_list<T> list);
+template<typename U, typename A, typename... Args>
+ shared_ptr<U> allocate_shared(const A& allocator, initializer_list<T> list);</pre>
<blockquote>
<p><b>Description:</b> These overloads initialize the array elements
from the initializer list.</p>
</blockquote>
- <pre>template<typename T, typename... Args>
- 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, const T (&list)[N]);</pre>
+ <pre>template<typename U, typename... Args>
+ shared_ptr<U> make_shared(const T (&list)[N]);
+template<typename U, typename A, typename... Args>
+ shared_ptr<U> 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, const T (&list)[N]);
-template<typename T, typename A, typename... Args>
- shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);</pre>
+ <pre>template<typename U, typename... Args>
+ shared_ptr<U> make_shared(size_t size, const T (&list)[N]);
+template<typename U, typename A, typename... Args>
+ shared_ptr<U> 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(const T (&list)[N]);
-template<typename T, typename A, typename... Args>
- shared_ptr<T[M][N]> allocate_shared(const A& allocator, const T (&list)[N]);</pre>
+ <pre>template<typename U, typename... Args> // U = T[M][N]
+ shared_ptr<U> make_shared(const T (&list)[N]);
+template<typename U, typename A, typename... Args> // U = T[M][N]
+ shared_ptr<U> 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>
- shared_ptr<T[]> make_shared(size_t size, T&& value);
-template<typename T, typename A>
- shared_ptr<T[]> allocate_shared(const A& allocator, size_t size, T&& value);</pre>
+ </blockquote>
+ <pre>template<typename U>
+ shared_ptr<U> make_shared(size_t size, T&& value);
+template<typename U, typename A>
+ shared_ptr<U> allocate_shared(const A& allocator, size_t size, T&& value);</pre>
<blockquote>
<p><b>Description:</b> These overloads initialize array elements with
the given value.</p>
</blockquote>
- <pre>template<typename T>
- shared_ptr<T[N]> make_shared(T&& value);
-template<typename T, typename A>
- shared_ptr<T[N]> allocate_shared(const A& allocator, T&& value);</pre>
+ <pre>template<typename U>
+ shared_ptr<U> make_shared(T&& value);
+template<typename U, typename A>
+ shared_ptr<U> allocate_shared(const A& allocator, T&& value);</pre>
<blockquote>
<p><b>Description:</b> These overloads of the utilities above are for a
fixed size array.</p>
</blockquote>
- <pre>template<typename T>
- shared_ptr<T[]> make_shared_noinit(size_t size);
-template<typename T, typename A>
- shared_ptr<T[]> allocate_shared_noinit(const A& allocator, size_t size);</pre>
+ <pre>template<typename U>
+ shared_ptr<U> make_shared_noinit(size_t size);
+template<typename U, typename A>
+ shared_ptr<U> allocate_shared_noinit(const A& allocator, size_t size);</pre>
<blockquote>
<p><b>Description:</b> These overloads do not perform any value
initialization of elements.</p>
</blockquote>
- <pre>template<typename T>
- shared_ptr<T[N]> make_shared_noinit();
-template<typename T, typename A>
- shared_ptr<T[N]> allocate_shared_noinit(const A& allocator);</pre>
+ <pre>template<typename U>
+ shared_ptr<U> make_shared_noinit();
+template<typename U, typename A>
+ shared_ptr<U> allocate_shared_noinit(const A& allocator);</pre>
<blockquote>
<p><b>Description:</b> These overloads of the utilities above are for a
fixed size array.</p>
@@ -221,7 +221,7 @@
<h2><a name="example">Example</a></h2>
<p>An example of each overload of make_shared for arrays:</p>
<blockquote>
- <pre>boost::shared_ptr<point[]> a1 = boost::make_shared<point[]>(size);
+ <pre>boost::shared_ptr<int[]> a1 = boost::make_shared<int[]>(size);
boost::shared_ptr<point[]> a2 = boost::make_shared<point[]>(size, x, y);
boost::shared_ptr<point[5]> a3 = boost::make_shared<point[5]>(x, y);
boost::shared_ptr<int[]> a4 = boost::make_shared<int[]>({1, 2, 3});
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk