forked from boostorg/smart_ptr
Add examples back to documentation
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
/*
|
||||
(c) 2014 Glen Joseph Fernandes
|
||||
<glenjofe -at- gmail.com>
|
||||
Copyright 2014 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software
|
||||
License, Version 1.0.
|
||||
http://boost.org/LICENSE_1_0.txt
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_MAKE_UNIQUE_HPP_INCLUDED
|
||||
#define BOOST_MAKE_UNIQUE_HPP_INCLUDED
|
||||
|
@ -105,8 +105,7 @@ const <em>E</em>& v);</code>
|
||||
<div id="requirements">
|
||||
<h2>Common Requirements</h2>
|
||||
<h3><code>template<class T, class A><br>shared_ptr<T>
|
||||
<a href="#functions">allocate_shared</a>(const A& a,
|
||||
<em>args</em>);</code></h3>
|
||||
allocate_shared(const A& a, <em>args</em>);</code></h3>
|
||||
<dl>
|
||||
<dt><strong>Requires:</strong></dt>
|
||||
<dd><code>T</code> is of the form <code>E[N]</code> or
|
||||
@ -190,6 +189,9 @@ allocate_shared(const A& a, std::size_t n);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared<int[]<!--
|
||||
-->>(std::allocator<int>(), 8);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -202,6 +204,9 @@ allocate_shared(const A& a);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared<int[8]<!--
|
||||
-->>(std::allocator<int>());</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -216,6 +221,9 @@ initialized to <code>v</code>.</dd>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared<double[]<!--
|
||||
-->>(std::allocator<double>(), 8, 1.0);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -229,6 +237,9 @@ where each array element of type <code>E</code> is initialized to
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared<double[8]<!--
|
||||
-->>(std::allocator<double>(), 1.0);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -241,6 +252,9 @@ allocate_shared_noinit(const A& a, std::size_t n);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared_noinit<int[]<!--
|
||||
-->>(std::allocator<int>(), 8);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -253,6 +267,9 @@ allocate_shared_noinit(const A& a);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::allocate_shared_noinit<int[8]<!--
|
||||
-->>(std::allocator<int>());</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -265,6 +282,8 @@ make_shared(std::size_t n);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared<int[]>(8);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -277,6 +296,8 @@ make_shared();</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared<int[8]>();</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -289,6 +310,8 @@ make_shared(std::size_t n, const <em>E</em>& v);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared<double[]>(8, 1.0);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -301,7 +324,8 @@ make_shared(const <em>E</em>& v);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N].</code></dd>
|
||||
</dl>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared<double[8]>(1.0);</code></dd></dl>
|
||||
</div>
|
||||
<div>
|
||||
<h3><code>template<class T><br>shared_ptr<T>
|
||||
@ -313,6 +337,8 @@ make_shared_noinit(std::size_t n);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared_noinit<int[]>(8);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -325,6 +351,8 @@ make_shared_noinit();</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[N]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_shared_noinit<int[8]>();</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -58,8 +58,7 @@ function template <code>make_unique</code> for convenient creation of
|
||||
<div id="requirements">
|
||||
<h2>Common Requirements</h2>
|
||||
<h3><code>template<class T, <em>Args</em>><br>
|
||||
std::unique_ptr<T>
|
||||
<a href="#functions">make_unique</a>(<em>args</em>);</code></h3>
|
||||
std::unique_ptr<T> make_unique(<em>args</em>);</code></h3>
|
||||
<dl>
|
||||
<dt><strong>Effects:</strong></dt>
|
||||
<dd>Allocates storage for an object of type <code>T</code> (or
|
||||
@ -109,6 +108,8 @@ initialized to <code>std::forward<Args>(args)...</code>.</dd>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is not an array type.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_unique<double>(1.0);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -121,7 +122,8 @@ initialized to <code>std::move(value)</code>.</dd>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is not an array type.</dd>
|
||||
</dl>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_unique<point>({1.0, -1.0});</code></dd></dl>
|
||||
</div>
|
||||
<div>
|
||||
<h3><code>template<class T><br>std::unique_ptr<T>
|
||||
@ -133,6 +135,8 @@ make_unique(std::size_t size);</code></h3>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_unique<int[]>(8);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -145,6 +149,8 @@ type <code>T</code>.</dd>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is not an array type.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_unique_noinit<std::tm>();</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@ -157,6 +163,8 @@ type <code>E[size]</code>.</dd>
|
||||
<dt><strong>Remarks:</strong></dt>
|
||||
<dd>This overload shall only participate in overload resolution when
|
||||
<code>T</code> is of the form <code>E[]</code>.</dd>
|
||||
<dt><strong>Example:</strong></dt>
|
||||
<dd><code>boost::make_unique_noinit<char[]>(64);</code></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user