mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-01 05:34:36 +02:00
Minor documentation corrections
This commit is contained in:
@@ -13,9 +13,9 @@
|
|||||||
<a href="#example">Examples</a><br>
|
<a href="#example">Examples</a><br>
|
||||||
<a href="#history">History</a></p>
|
<a href="#history">History</a></p>
|
||||||
<h2><a name="Introduction">Introduction</a></h2>
|
<h2><a name="Introduction">Introduction</a></h2>
|
||||||
<p>The header file <boost/make_unique.hpp> provides a family of
|
<p>The header file <boost/make_unique.hpp> provides overloaded
|
||||||
overloaded function template <code>make_unique</code> for convenient
|
function template <code>make_unique</code> for convenient creation of
|
||||||
creation of <code>unique_ptr</code> objects.</p>
|
<code>unique_ptr</code> objects.</p>
|
||||||
<h2><a name="Synopsis">Synopsis</a></h2>
|
<h2><a name="Synopsis">Synopsis</a></h2>
|
||||||
<pre>namespace boost {
|
<pre>namespace boost {
|
||||||
template<typename U> // U is not array
|
template<typename U> // U is not array
|
||||||
@@ -69,20 +69,20 @@ unique_ptr<U> make_unique_noinit();</pre>
|
|||||||
<pre>template<typename U> // U is T[]
|
<pre>template<typename U> // U is T[]
|
||||||
unique_ptr<U> make_unique(size_t size);</pre>
|
unique_ptr<U> make_unique(size_t size);</pre>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><b>Requires:</b> The expression <code>new U()</code> shall be
|
<p><b>Requires:</b> The expression <code>new T[size]()</code> shall be
|
||||||
well-formed.</p>
|
well-formed.</p>
|
||||||
<p><b>Effects:</b> Constructs an array of objects of type
|
<p><b>Effects:</b> Constructs an array of objects of type
|
||||||
<code>U</code> and size <code>size</code> via the expression
|
<code>U</code> and size <code>size</code> via the expression
|
||||||
<code>new U[size]()</code>.</p>
|
<code>new T[size]()</code>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<pre>template<typename U> // U is T[]
|
<pre>template<typename U> // U is T[]
|
||||||
unique_ptr<U> make_unique_noinit(size_t size);</pre>
|
unique_ptr<U> make_unique_noinit(size_t size);</pre>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><b>Requires:</b> The expression <code>new U</code> shall be
|
<p><b>Requires:</b> The expression <code>new T[size]</code> shall be
|
||||||
well-formed.</p>
|
well-formed.</p>
|
||||||
<p><b>Effects:</b> Constructs an array of objects of type
|
<p><b>Effects:</b> Constructs an array of objects of type
|
||||||
<code>U</code> and size <code>size</code> via the expression
|
<code>U</code> and size <code>size</code> via the expression
|
||||||
<code>new U[size]</code>.</p>
|
<code>new T[size]</code>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h2><a name="example">Examples</a></h2>
|
<h2><a name="example">Examples</a></h2>
|
||||||
<p>For objects with value-initialization.</p>
|
<p>For objects with value-initialization.</p>
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition,
|
described in Bjarne Stroustrup's "The C++ Programming Language", 3rd edition,
|
||||||
Section 14.4, Resource Management.</p>
|
Section 14.4, Resource Management.</p>
|
||||||
<p>Additionally, the smart pointer library provides efficient factory functions
|
<p>Additionally, the smart pointer library provides efficient factory functions
|
||||||
for creating <code>shared_ptr</code> objects:</p>
|
for creating smart pointer objects:</p>
|
||||||
<div align="left">
|
<div align="left">
|
||||||
<table border="1" cellpadding="4" cellspacing="0">
|
<table border="1" cellpadding="4" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -137,8 +137,9 @@
|
|||||||
throwing exceptions by the <a href="#common_requirements">common requirements</a>.</p>
|
throwing exceptions by the <a href="#common_requirements">common requirements</a>.</p>
|
||||||
<h2><a name="History">History</a> and Acknowledgements</h2>
|
<h2><a name="History">History</a> and Acknowledgements</h2>
|
||||||
<p>January 2014. Glen Fernandes confined the overloads of <b>make_shared</b>
|
<p>January 2014. Glen Fernandes confined the overloads of <b>make_shared</b>
|
||||||
and <b>allocate_shared</b> for arrays to the specification in N3870 and
|
and <b>allocate_shared</b> for arrays to the specification in
|
||||||
implemented <b>make_unique</b> for arrays and objects.</p>
|
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3870.html">N3870</a>
|
||||||
|
and implemented <b>make_unique</b> for arrays and objects.</p>
|
||||||
<p>November 2012. Glen Fernandes provided implementations of <b>make_shared</b>
|
<p>November 2012. Glen Fernandes provided implementations of <b>make_shared</b>
|
||||||
and <b>allocate_shared</b> for arrays. They achieve a single allocation for an
|
and <b>allocate_shared</b> for arrays. They achieve a single allocation for an
|
||||||
array that can be initialized with constructor arguments or initializer lists
|
array that can be initialized with constructor arguments or initializer lists
|
||||||
|
Reference in New Issue
Block a user