summaryrefslogtreecommitdiff
path: root/doc/html/variant/tutorial.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/variant/tutorial.html')
-rw-r--r--doc/html/variant/tutorial.html19
1 files changed, 10 insertions, 9 deletions
diff --git a/doc/html/variant/tutorial.html b/doc/html/variant/tutorial.html
index 21a3e6ec8a..9d5ac6055e 100644
--- a/doc/html/variant/tutorial.html
+++ b/doc/html/variant/tutorial.html
@@ -77,15 +77,15 @@
contained value. There are two ways to accomplish this:
<code class="computeroutput"><a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a></code>, which is safest
and very powerful, and
- <code class="computeroutput"><a class="link" href="../boost/get_idp94543392.html" title="Function get">get</a>&lt;T&gt;</code>, which is
+ <code class="computeroutput"><a class="link" href="../boost/get_idp108797984.html" title="Function get">get</a>&lt;T&gt;</code>, which is
sometimes more convenient to use.</p>
<p>For instance, suppose we wanted to concatenate to the string contained
in <code class="computeroutput">v</code>. With <span class="bold"><strong>value retrieval</strong></span>
- by <code class="computeroutput"><a class="link" href="../boost/get_idp94543392.html" title="Function get">get</a></code>, this may be accomplished
+ by <code class="computeroutput"><a class="link" href="../boost/get_idp108797984.html" title="Function get">get</a></code>, this may be accomplished
quite simply, as seen in the following:
</p>
-<pre class="programlisting">std::string&amp; str = <code class="computeroutput"><a class="link" href="../boost/get_idp94543392.html" title="Function get">boost::get</a></code>&lt;std::string&gt;(v);
+<pre class="programlisting">std::string&amp; str = <code class="computeroutput"><a class="link" href="../boost/get_idp108797984.html" title="Function get">boost::get</a></code>&lt;std::string&gt;(v);
str += " world! ";</pre>
<p>
@@ -112,9 +112,9 @@ str += " world! ";</pre>
</p>
<pre class="programlisting">void times_two( boost::variant&lt; int, std::string &gt; &amp; operand )
{
- if ( int* pi = <code class="computeroutput"><a class="link" href="../boost/get_idp94543392.html" title="Function get">boost::get</a></code>&lt;int&gt;( &amp;operand ) )
+ if ( int* pi = <code class="computeroutput"><a class="link" href="../boost/get_idp108797984.html" title="Function get">boost::get</a></code>&lt;int&gt;( &amp;operand ) )
*pi *= 2;
- else if ( std::string* pstr = <code class="computeroutput"><a class="link" href="../boost/get_idp94543392.html" title="Function get">boost::get</a></code>&lt;std::string&gt;( &amp;operand ) )
+ else if ( std::string* pstr = <code class="computeroutput"><a class="link" href="../boost/get_idp108797984.html" title="Function get">boost::get</a></code>&lt;std::string&gt;( &amp;operand ) )
*pstr += *pstr;
}</pre>
<p>
@@ -509,7 +509,7 @@ int_tree_t var(result);</pre>
<code class="computeroutput">var</code> as <code class="computeroutput">( 1 ( 3 5 ) 7 )</code>.</p>
<p>Finally, note that a type sequence can be used to specify the bounded
types of a recursive <code class="computeroutput">variant</code> via the use of
- <code class="computeroutput"><a class="link" href="../boost/make_recursiv_idp351329984.html" title="Class template make_recursive_variant_over">boost::make_recursive_variant_over</a></code>,
+ <code class="computeroutput"><a class="link" href="../boost/make_recursiv_idp295097024.html" title="Class template make_recursive_variant_over">boost::make_recursive_variant_over</a></code>,
whose semantics are the same as <code class="computeroutput">make_variant_over</code> (which is
described in <a class="xref" href="tutorial.html#variant.tutorial.over-sequence" title="Using a type sequence to specify bounded types">the section called &#8220;Using a type sequence to specify bounded types&#8221;</a>).</p>
<p><span class="bold"><strong>Portability</strong></span>: Unfortunately, due to
@@ -634,19 +634,20 @@ struct if_visitor: public <code class="computeroutput"><a class="link" href="../
</p>
<pre class="programlisting">
-bool_like_t v0(1), v1(true), v2(1.0);
+bool_like_t v0(true), v1(1), v2(2.0);
assert(
<code class="computeroutput"><a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">boost::apply_visitor</a></code>(if_visitor(), v0, v1, v2)
==
- arithmetics_t(true)
+ arithmetics_t(1)
);
</pre>
<p>
</p>
<p>Finally, we must note that multi visitation does not support
"delayed" form of
- <code class="computeroutput"><a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a></code>.
+ <code class="computeroutput"><a class="link" href="../boost/apply_visitor.html" title="Function apply_visitor">apply_visitor</a> if
+ <a class="link" href="../BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES.html" title="Macro BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES">BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES</a> is defined</code>.
</p>
</div>
</div>