Add examples back to documentation

This commit is contained in:
Glen Fernandes
2017-03-13 10:59:58 -04:00
committed by GitHub
parent 687d31b7c8
commit 71ef7850ab
3 changed files with 46 additions and 11 deletions

View File

@ -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

View File

@ -105,8 +105,7 @@ const <em>E</em>&amp; v);</code>
<div id="requirements">
<h2>Common Requirements</h2>
<h3><code>template&lt;class T, class A&gt;<br>shared_ptr&lt;T&gt;
<a href="#functions">allocate_shared</a>(const A&amp; a,
<em>args</em>);</code></h3>
allocate_shared(const A&amp; 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&amp; 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&lt;int[]<!--
-->&gt;(std::allocator&lt;int&gt;(), 8);</code></dd>
</dl>
</div>
<div>
@ -202,6 +204,9 @@ allocate_shared(const A&amp; 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&lt;int[8]<!--
-->&gt;(std::allocator&lt;int&gt;());</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&lt;double[]<!--
-->&gt;(std::allocator&lt;double&gt;(), 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&lt;double[8]<!--
-->&gt;(std::allocator&lt;double&gt;(), 1.0);</code></dd>
</dl>
</div>
<div>
@ -241,6 +252,9 @@ allocate_shared_noinit(const A&amp; 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&lt;int[]<!--
-->&gt;(std::allocator&lt;int&gt;(), 8);</code></dd>
</dl>
</div>
<div>
@ -253,6 +267,9 @@ allocate_shared_noinit(const A&amp; 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&lt;int[8]<!--
-->&gt;(std::allocator&lt;int&gt;());</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&lt;int[]&gt;(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&lt;int[8]&gt;();</code></dd>
</dl>
</div>
<div>
@ -289,6 +310,8 @@ make_shared(std::size_t n, const <em>E</em>&amp; 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&lt;double[]&gt;(8, 1.0);</code></dd>
</dl>
</div>
<div>
@ -301,7 +324,8 @@ make_shared(const <em>E</em>&amp; 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&lt;double[8]&gt;(1.0);</code></dd></dl>
</div>
<div>
<h3><code>template&lt;class T&gt;<br>shared_ptr&lt;T&gt;
@ -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&lt;int[]&gt;(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&lt;int[8]&gt;();</code></dd>
</dl>
</div>
</div>

View File

@ -58,8 +58,7 @@ function template <code>make_unique</code> for convenient creation of
<div id="requirements">
<h2>Common Requirements</h2>
<h3><code>template&lt;class T, <em>Args</em>&gt;<br>
std::unique_ptr&lt;T&gt;
<a href="#functions">make_unique</a>(<em>args</em>);</code></h3>
std::unique_ptr&lt;T&gt; 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&lt;Args&gt;(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&lt;double&gt;(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&lt;point&gt;({1.0, -1.0});</code></dd></dl>
</div>
<div>
<h3><code>template&lt;class T&gt;<br>std::unique_ptr&lt;T&gt;
@ -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&lt;int[]&gt;(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&lt;std::tm&gt;();</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&lt;char[]&gt;(64);</code></dd>
</dl>
</div>
</div>