Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83828 - in branches/release: . libs libs/smart_ptr
From: glenfe_at_[hidden]
Date: 2013-04-10 01:03:45


Author: glenfe
Date: 2013-04-10 01:03:45 EDT (Wed, 10 Apr 2013)
New Revision: 83828
URL: http://svn.boost.org/trac/boost/changeset/83828

Log:
Merge revision(s) 83827 from trunk:
Small improvements to make_shared documentation.
........

Properties modified:
   branches/release/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/smart_ptr/ (props changed)
Text files modified:
   branches/release/libs/smart_ptr/make_shared_array.html | 186 ++++++++++++++++++++--------------------
   1 files changed, 93 insertions(+), 93 deletions(-)

Modified: branches/release/libs/smart_ptr/make_shared_array.html
==============================================================================
--- branches/release/libs/smart_ptr/make_shared_array.html (original)
+++ branches/release/libs/smart_ptr/make_shared_array.html 2013-04-10 01:03:45 EDT (Wed, 10 Apr 2013)
@@ -29,85 +29,85 @@
       allowing finer control.</p>
     <h2><a name="Synopsis">Synopsis</a></h2>
     <pre>namespace boost {
- template&lt;typename T&gt;
- shared_ptr&lt;T[]&gt; make_shared(size_t size);
+ template&lt;typename U&gt; // U = T[]
+ shared_ptr&lt;U&gt; make_shared(size_t size);
 
- template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size);
-
-#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) &amp;&amp; !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[]&gt; make_shared(size_t size, Args&amp;&amp;... args);
+ template&lt;typename U, typename A&gt; // U = T[]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size);
 
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; make_shared(Args&amp;&amp;... args);
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) &amp;&amp; !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template&lt;typename U, typename... Args&gt; // U = T[]
+ shared_ptr&lt;U&gt; make_shared(size_t size, Args&amp;&amp;... args);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size, Args&amp;&amp;... args);
+ template&lt;typename U, typename... Args&gt; // U = T[N]
+ shared_ptr&lt;U&gt; make_shared(Args&amp;&amp;... args);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, Args&amp;&amp;... args);
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, Args&amp;&amp;... args);
+
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[N]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, Args&amp;&amp;... args);
 #endif
-
-#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; make_shared(const T (&amp;list)[N]);
 
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[][N]&gt; make_shared(size_t size, const T (&amp;list)[N]);
+#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
+ template&lt;typename U, typename... Args&gt; // U = T[N]
+ shared_ptr&lt;U&gt; make_shared(const T (&amp;list)[N]);
+
+ template&lt;typename U, typename... Args&gt; // U = T[][N]
+ shared_ptr&lt;U&gt; make_shared(size_t size, const T (&amp;list)[N]);
 
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[M][N]&gt; make_shared(const T (&amp;list)[N]);
+ template&lt;typename U, typename... Args&gt; // U = T[M][N]
+ shared_ptr&lt;U&gt; make_shared(const T (&amp;list)[N]);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[N]
+ shared_ptr&lt;T[&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[][N]&gt; allocate_shared(const A&amp; allocator, size_t size, const T (&amp;list)[N]);
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[][N]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, const T (&amp;list)[N]);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[M][N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[M][N]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);
 
 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
- template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[]&gt; make_shared(initializer_list&lt;T&gt; list);
+ template&lt;typename U, typename... Args&gt; // U = T[]
+ shared_ptr&lt;U&gt; make_shared(initializer_list&lt;T&gt; list);
 
- template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, initializer_list&lt;T&gt; list);
+ template&lt;typename U, typename A, typename... Args&gt; // U = T[]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, initializer_list&lt;T&gt; list);
 #endif
 
-#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- template&lt;typename T&gt;
- shared_ptr&lt;T[]&gt; make_shared(size_t size, T&amp;&amp; value);
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ template&lt;typename U&gt; // U = T[]
+ shared_ptr&lt;U&gt; make_shared(size_t size, T&amp;&amp; value);
 
- template&lt;typename T&gt;
- shared_ptr&lt;T[N]&gt; make_shared(T&amp;&amp; value);
+ template&lt;typename U&gt; // U = T[N]
+ shared_ptr&lt;U&gt; make_shared(T&amp;&amp; value);
 
- template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size, T&amp;&amp; value);
+ template&lt;typename U, typename A&gt; // U = T[]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, T&amp;&amp; value);
 
- template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, T&amp;&amp; value);
+ template&lt;typename U, typename A&gt; // U = T[N]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, T&amp;&amp; value);
 #endif
 #endif
 
- template&lt;typename T&gt;
- shared_ptr&lt;T[]&gt; make_shared_noinit(size_t size);
+ template&lt;typename U&gt; // U = T[]
+ shared_ptr&lt;U&gt; make_shared_noinit(size_t size);
+
+ template&lt;typename U&gt; // U = T[N]
+ shared_ptr&lt;U&gt; make_shared_noinit();
 
- template&lt;typename T&gt;
- shared_ptr&lt;T[N]&gt; make_shared_noinit();
-
- template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[]&gt; allocate_shared_noinit(const A&amp; allocator, size_t size);
+ template&lt;typename U, typename A&gt; // U = T[]
+ shared_ptr&lt;U&gt; allocate_shared_noinit(const A&amp; allocator, size_t size);
 
- template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared_noinit(const A&amp; allocator);
+ template&lt;typename U, typename A&gt; // U = T[N]
+ shared_ptr&lt;U&gt; allocate_shared_noinit(const A&amp; allocator);
 }</pre>
     <h2><a name="functions">Free Functions</a></h2>
- <pre>template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[]&gt; make_shared(size_t size, Args&amp;&amp;... args);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size, Args&amp;&amp;... args);</pre>
+ <pre>template&lt;typename U, typename... Args&gt;
+ shared_ptr&lt;U&gt; make_shared(size_t size, Args&amp;&amp;... args);
+template&lt;typename U, typename A, typename... Args&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, Args&amp;&amp;... args);</pre>
     <blockquote>
       <p><b>Requires:</b> The expression
         <code>new(pointer) T(forward&lt;Args&gt;(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&lt;Args&gt;(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&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; make_shared(Args&amp;&amp;... args);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, Args&amp;&amp;... args);</pre>
+ <pre>template&lt;typename U, typename... Args&gt;
+ shared_ptr&lt;U&gt; make_shared(Args&amp;&amp;... args);
+template&lt;typename U, typename A, typename... Args&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, Args&amp;&amp;... args);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads of the utilities above are for a
         fixed size array.</p>
     </blockquote>
- <pre>template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[]&gt; make_shared(initializer_list&lt;T&gt; list);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, initializer_list&lt;T&gt; list);</pre>
+ <pre>template&lt;typename U, typename... Args&gt;
+ shared_ptr&lt;U&gt; make_shared(initializer_list&lt;T&gt; list);
+template&lt;typename U, typename A, typename... Args&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, initializer_list&lt;T&gt; list);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads initialize the array elements
         from the initializer list.</p>
     </blockquote>
- <pre>template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; make_shared(const T (&amp;list)[N]);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);</pre>
+ <pre>template&lt;typename U, typename... Args&gt;
+ shared_ptr&lt;U&gt; make_shared(const T (&amp;list)[N]);
+template&lt;typename U, typename A, typename... Args&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads of the utilities above are for a
         fixed size array.</p>
     </blockquote>
- <pre>template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[][N]&gt; make_shared(size_t size, const T (&amp;list)[N]);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[][N]&gt; allocate_shared(const A&amp; allocator, size_t size, const T (&amp;list)[N]);</pre>
+ <pre>template&lt;typename U, typename... Args&gt;
+ shared_ptr&lt;U&gt; make_shared(size_t size, const T (&amp;list)[N]);
+template&lt;typename U, typename A, typename... Args&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, const T (&amp;list)[N]);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads initialize inner array elements
         from the initializer list.</p>
     </blockquote>
- <pre>template&lt;typename T, typename... Args&gt;
- shared_ptr&lt;T[M][N]&gt; make_shared(const T (&amp;list)[N]);
-template&lt;typename T, typename A, typename... Args&gt;
- shared_ptr&lt;T[M][N]&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);</pre>
+ <pre>template&lt;typename U, typename... Args&gt; // U = T[M][N]
+ shared_ptr&lt;U&gt; make_shared(const T (&amp;list)[N]);
+template&lt;typename U, typename A, typename... Args&gt; // U = T[M][N]
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, const T (&amp;list)[N]);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads of the utilities above are for a
         fixed size array.</p>
- </blockquote>
- <pre>template&lt;typename T&gt;
- shared_ptr&lt;T[]&gt; make_shared(size_t size, T&amp;&amp; value);
-template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[]&gt; allocate_shared(const A&amp; allocator, size_t size, T&amp;&amp; value);</pre>
+ </blockquote>
+ <pre>template&lt;typename U&gt;
+ shared_ptr&lt;U&gt; make_shared(size_t size, T&amp;&amp; value);
+template&lt;typename U, typename A&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, size_t size, T&amp;&amp; value);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads initialize array elements with
         the given value.</p>
     </blockquote>
- <pre>template&lt;typename T&gt;
- shared_ptr&lt;T[N]&gt; make_shared(T&amp;&amp; value);
-template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared(const A&amp; allocator, T&amp;&amp; value);</pre>
+ <pre>template&lt;typename U&gt;
+ shared_ptr&lt;U&gt; make_shared(T&amp;&amp; value);
+template&lt;typename U, typename A&gt;
+ shared_ptr&lt;U&gt; allocate_shared(const A&amp; allocator, T&amp;&amp; value);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads of the utilities above are for a
         fixed size array.</p>
     </blockquote>
- <pre>template&lt;typename T&gt;
- shared_ptr&lt;T[]&gt; make_shared_noinit(size_t size);
-template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[]&gt; allocate_shared_noinit(const A&amp; allocator, size_t size);</pre>
+ <pre>template&lt;typename U&gt;
+ shared_ptr&lt;U&gt; make_shared_noinit(size_t size);
+template&lt;typename U, typename A&gt;
+ shared_ptr&lt;U&gt; allocate_shared_noinit(const A&amp; allocator, size_t size);</pre>
     <blockquote>
       <p><b>Description:</b> These overloads do not perform any value
         initialization of elements.</p>
     </blockquote>
- <pre>template&lt;typename T&gt;
- shared_ptr&lt;T[N]&gt; make_shared_noinit();
-template&lt;typename T, typename A&gt;
- shared_ptr&lt;T[N]&gt; allocate_shared_noinit(const A&amp; allocator);</pre>
+ <pre>template&lt;typename U&gt;
+ shared_ptr&lt;U&gt; make_shared_noinit();
+template&lt;typename U, typename A&gt;
+ shared_ptr&lt;U&gt; allocate_shared_noinit(const A&amp; 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&lt;point[]&gt; a1 = boost::make_shared&lt;point[]&gt;(size);
+ <pre>boost::shared_ptr&lt;int[]&gt; a1 = boost::make_shared&lt;int[]&gt;(size);
 boost::shared_ptr&lt;point[]&gt; a2 = boost::make_shared&lt;point[]&gt;(size, x, y);
 boost::shared_ptr&lt;point[5]&gt; a3 = boost::make_shared&lt;point[5]&gt;(x, y);
 boost::shared_ptr&lt;int[]&gt; a4 = boost::make_shared&lt;int[]&gt;({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