Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81408 - trunk/libs/smart_ptr
From: glenfe_at_[hidden]
Date: 2012-11-17 20:51:46


Author: glenfe
Date: 2012-11-17 20:51:46 EST (Sat, 17 Nov 2012)
New Revision: 81408
URL: http://svn.boost.org/trac/boost/changeset/81408

Log:
Documentation of make_shared_array: Minor corrections
Text files modified:
   trunk/libs/smart_ptr/make_shared_array.html | 13 ++++++++-----
   1 files changed, 8 insertions(+), 5 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 2012-11-17 20:51:46 EST (Sat, 17 Nov 2012)
@@ -41,7 +41,7 @@
     shared_ptr<T[N]> make_shared(Args&&... args);
     
     template<typename T, typename A, typename... Args>
- shared_ptr<T> allocate_shared(const A& allocator, size_t size, Args&&... args);
+ shared_ptr<T[]> allocate_shared(const A& allocator, size_t size, Args&&... args);
     
     template<typename T, typename A, typename... Args>
     shared_ptr<T[N]> allocate_shared(const A& allocator, Args&&... args);
@@ -74,7 +74,7 @@
 #endif
 
     template<typename T>
- shared_ptr<T> make_shared_noinit(size_t size);
+ shared_ptr<T[]> make_shared_noinit(size_t size);
     
     template<typename T>
     shared_ptr<T[N]> make_shared_noinit();
@@ -123,15 +123,18 @@
         constructor of <code>T</code> for each array element.</p>
     </blockquote>
     <h2><a name="example">Example</a></h2>
- <pre>boost::shared_ptr&lt;int[]&gt; a1 = boost::make_shared&lt;int[]&gt;(size);
-boost::shared_ptr&lt;point[5]&gt; a2 = boost::make_shared&lt;point[5]&gt;(x, y);
-boost::shared_ptr&lt;int[5]&gt; a3 = boost::make_shared&lt;int[5]&gt;();
+ <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);
+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::shared_ptr&lt;int[3]&gt; a5 = boost::make_shared&lt;int[3]&gt;({1, 2, 3});
 boost::shared_ptr&lt;int[][3]&gt; a6 = boost::make_shared&lt;int[][3]&gt;(size, {1, 2, 3});
 boost::shared_ptr&lt;int[5][3]&gt; a7 = boost::make_shared&lt;int[5][3]&gt;({1, 2, 3});
 boost::shared_ptr&lt;int[]&gt; a8 = boost::make_shared_noinit&lt;int[]&gt;(size);
 boost::shared_ptr&lt;int[5]&gt; a9 = boost::make_shared_noinit&lt;int[5]&gt;();</pre>
+ </blockquote>
     <hr>
     <p>$Date: 2012-10-30 10:12:25 -0800 (Tue, 30 Oct 2012) $</p>
     <p><small>Copyright 2012 Glen Fernandes. Distributed under the Boost


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