diff options
Diffstat (limited to 'doc/html/boost/type_erasure/placeholder.html')
-rw-r--r-- | doc/html/boost/type_erasure/placeholder.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/html/boost/type_erasure/placeholder.html b/doc/html/boost/type_erasure/placeholder.html index 4c3e3c07ab..528078e778 100644 --- a/doc/html/boost/type_erasure/placeholder.html +++ b/doc/html/boost/type_erasure/placeholder.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Struct placeholder</title> <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.placeholder_hpp" title="Header <boost/type_erasure/placeholder.hpp>"> <link rel="prev" href="as_param.html" title="Struct template as_param"> @@ -36,11 +36,11 @@ <span class="keyword">struct</span> <a class="link" href="placeholder.html" title="Struct placeholder">placeholder</a> <span class="special">{</span> <span class="special">}</span><span class="special">;</span></pre></div> <div class="refsect1"> -<a name="idp451068912"></a><h2>Description</h2> +<a name="idm45927739062624"></a><h2>Description</h2> <p>Placeholders are used heavily throughout the library. Every placeholder must derive from <a class="link" href="placeholder.html" title="Struct placeholder">placeholder</a>. The library provides a number of placeholders, out of the box, but you are welcome to define your own, if you want more descriptive names. The placeholder <a class="link" href="_self.html" title="Struct _self">_self</a> is special in that it is used as the default wherever possible.</p> <p>What exactly is a placeholder? Placeholders act as a substitute for template parameters in concepts. The library automatically replaces all the placeholders used in a concept with the actual types involved when it stores an object in an <a class="link" href="any.html" title="Class template any">any</a>.</p> <p>For example, in the following,</p> -<pre class="programlisting"> <span class="identifier">any</span><span class="special"><</span><span class="identifier">copy_constructible</span><span class="special"><</span><span class="identifier">_a</span><span class="special">></span><span class="special">,</span> <span class="identifier">_a</span><span class="special">></span> <span class="identifier">x</span><span class="special">(</span><span class="number">1</span><span class="special">)</span><span class="special">;</span> +<pre class="programlisting"><span class="identifier">any</span><span class="special"><</span><span class="identifier">copy_constructible</span><span class="special"><</span><span class="identifier">_a</span><span class="special">></span><span class="special">,</span> <span class="identifier">_a</span><span class="special">></span> <span class="identifier">x</span><span class="special">(</span><span class="number">1</span><span class="special">)</span><span class="special">;</span> </pre> <p>The library sees that we're constructing an <a class="link" href="any.html" title="Class template any">any</a> that uses the <a class="link" href="_a.html" title="Struct _a">_a</a> placeholder with an <code class="computeroutput">int</code>. Thus it binds <a class="link" href="_a.html" title="Struct _a">_a</a> to int and instantiates <a class="link" href="copy_constructible.html" title="Struct template copy_constructible">copy_constructible<int></a>.</p> <p>When there are multiple placeholders involved, you will have to use <a class="link" href="tuple.html" title="Class template tuple">tuple</a>, or pass the bindings explicitly, but the substitution still works the same way. </p> |