diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-08-26 08:15:55 -0400 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-08-26 08:15:55 -0400 |
commit | bb4dd8289b351fae6b55e303f189127a394a1edd (patch) | |
tree | 77c9c35a31b1459dd7988c2448e797d142530c41 /doc/html/variant/tutorial.html | |
parent | 1a78a62555be32868418fe52f8e330c9d0f95d5a (diff) | |
download | boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.gz boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.bz2 boost-bb4dd8289b351fae6b55e303f189127a394a1edd.zip |
Imported Upstream version 1.51.0upstream/1.51.0
Diffstat (limited to 'doc/html/variant/tutorial.html')
-rw-r--r--[-rwxr-xr-x] | doc/html/variant/tutorial.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/html/variant/tutorial.html b/doc/html/variant/tutorial.html index 6d49fe53eb..de5e379607 100755..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_id1673528.html" title="Function get">get</a><T></code>, which is + <code class="computeroutput"><a class="link" href="../boost/get_id1573726.html" title="Function get">get</a><T></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_id1673528.html" title="Function get">get</a></code>, this may be accomplished + by <code class="computeroutput"><a class="link" href="../boost/get_id1573726.html" title="Function get">get</a></code>, this may be accomplished quite simply, as seen in the following: </p> -<pre class="programlisting">std::string& str = <code class="computeroutput"><a class="link" href="../boost/get_id1673528.html" title="Function get">boost::get</a></code><std::string>(v); +<pre class="programlisting">std::string& str = <code class="computeroutput"><a class="link" href="../boost/get_id1573726.html" title="Function get">boost::get</a></code><std::string>(v); str += " world! ";</pre> <p> @@ -112,9 +112,9 @@ str += " world! ";</pre> </p> <pre class="programlisting">void times_two( boost::variant< int, std::string > & operand ) { - if ( int* pi = <code class="computeroutput"><a class="link" href="../boost/get_id1673528.html" title="Function get">boost::get</a></code><int>( &operand ) ) + if ( int* pi = <code class="computeroutput"><a class="link" href="../boost/get_id1573726.html" title="Function get">boost::get</a></code><int>( &operand ) ) *pi *= 2; - else if ( std::string* pstr = <code class="computeroutput"><a class="link" href="../boost/get_id1673528.html" title="Function get">boost::get</a></code><std::string>( &operand ) ) + else if ( std::string* pstr = <code class="computeroutput"><a class="link" href="../boost/get_id1573726.html" title="Function get">boost::get</a></code><std::string>( &operand ) ) *pstr += *pstr; }</pre> <p> @@ -505,7 +505,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_recursive_variant__id1790944.html" title="Class template make_recursive_variant_over">boost::make_recursive_variant_over</a></code>, + <code class="computeroutput"><a class="link" href="../boost/make_recursive_v_id1592281.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 “Using a type sequence to specify bounded types”</a>).</p> <p><span class="bold"><strong>Portability</strong></span>: Unfortunately, due to |