Integrate Tie with other HTML files

[SVN r7866]
This commit is contained in:
Beman Dawes 2000-09-28 12:35:46 +00:00
parent f51ee4ef2e
commit 1f2a827df3
4 changed files with 13 additions and 13 deletions

View File

@ -617,7 +617,7 @@ uses the three adaptors.
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->18 Sep 2000<!--webbot bot="Timestamp" endspan i-checksum="14937" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->27 Sep 2000<!--webbot bot="Timestamp" endspan i-checksum="14936" --></p>
<p>© Copyright Jeremy Siek 2000. Permission to copy, use, <p>© Copyright Jeremy Siek 2000. Permission to copy, use,
modify, sell and distribute this document is granted provided this copyright modify, sell and distribute this document is granted provided this copyright
notice appears in all copies. This document is provided &quot;as is&quot; notice appears in all copies. This document is provided &quot;as is&quot;

View File

@ -585,7 +585,7 @@ complicated than the old one, we think it's worth it to make the library more
useful in real world. Alexy Gurtovoy contributed the code which supports the new useful in real world. Alexy Gurtovoy contributed the code which supports the new
usage idiom while allowing the library remain backward-compatible.</p> usage idiom while allowing the library remain backward-compatible.</p>
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->24 Sep 2000<!--webbot bot="Timestamp" endspan i-checksum="14930" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->27 Sep 2000<!--webbot bot="Timestamp" endspan i-checksum="14936" --></p>
<p>© Copyright David Abrahams and Beman Dawes 1999-2000. Permission to copy, <p>© Copyright David Abrahams and Beman Dawes 1999-2000. Permission to copy,
use, modify, sell and distribute this document is granted provided this use, modify, sell and distribute this document is granted provided this
copyright notice appears in all copies. This document is provided &quot;as copyright notice appears in all copies. This document is provided &quot;as

View File

@ -31,7 +31,7 @@ tied&lt;A,B&gt; tie(A&amp; a, B&amp; b);
<P> <P>
This is a utility function that makes it more convenient to work with This is a utility function that makes it more convenient to work with
a function which returns a pair. The effect of the <TT>tie()</TT> a function which returns a std::pair&lt;&gt;. The effect of the <TT>tie()</TT>
function is to allow the assignment of the two values of the pair to function is to allow the assignment of the two values of the pair to
two separate variables. The idea for this comes from Jaakko two separate variables. The idea for this comes from Jaakko
J&#228;rvi's Binders&nbsp;[<A J&#228;rvi's Binders&nbsp;[<A
@ -63,8 +63,7 @@ pair of iterators is assigned to the iterator variables <TT>i</TT> and
</PRE> </PRE>
<P> <P>
Here is another example that uses <TT>tie()</TT> for handling Here is another example that uses <TT>tie()</TT> for handling operations with <a
operaitons with <a
href="http://www.sgi.com/Technology/STL/set.html"><TT>std::set</TT></a>. href="http://www.sgi.com/Technology/STL/set.html"><TT>std::set</TT></a>.
<P> <P>
@ -92,9 +91,9 @@ main(int, char*[])
for (int k = 0; k &lt; 2; ++k) { for (int k = 0; k &lt; 2; ++k) {
boost::tie(i,inserted) = s.insert(new_vals[k]); boost::tie(i,inserted) = s.insert(new_vals[k]);
if (!inserted) if (!inserted)
std::cout &lt;&lt; *i &lt;&lt; " was already in the set." &lt;&lt; std::endl; std::cout &lt;&lt; *i &lt;&lt; &quot; was already in the set.&quot; &lt;&lt; std::endl;
else else
std::cout &lt;&lt; *i &lt;&lt; " successfully inserted." &lt;&lt; std::endl; std::cout &lt;&lt; *i &lt;&lt; &quot; successfully inserted.&quot; &lt;&lt; std::endl;
} }
} }
{ {
@ -105,8 +104,8 @@ main(int, char*[])
// Using tie() with a return value of pair&lt;iterator,iterator&gt; // Using tie() with a return value of pair&lt;iterator,iterator&gt;
boost::tie(i,end) = std::equal_range(vals, vals + 6, 4); boost::tie(i,end) = std::equal_range(vals, vals + 6, 4);
std::cout &lt;&lt; "There were " &lt;&lt; std::distance(i,end) std::cout &lt;&lt; &quot;There were &quot; &lt;&lt; std::distance(i,end)
&lt;&lt; " occurances of " &lt;&lt; *i &lt;&lt; "." &lt;&lt; std::endl; &lt;&lt; &quot; occurrences of &quot; &lt;&lt; *i &lt;&lt; &quot;.&quot; &lt;&lt; std::endl;
// Footnote: of course one would normally just use std::count() // Footnote: of course one would normally just use std::count()
// to get this information, but that would spoil the example :) // to get this information, but that would spoil the example :)
} }
@ -117,7 +116,7 @@ The output is:
<PRE> <PRE>
3 successfully inserted. 3 successfully inserted.
9 was already in the set. 9 was already in the set.
There were 2 occurances of 4. There were 2 occurrences of 4.
</PRE> </PRE>
<br> <br>

View File

@ -16,10 +16,11 @@
<h2>Contents</h2> <h2>Contents</h2>
<ul> <ul>
<li>Template functions <a href="#functions next">next() and prior()</a></li> <li>Function templates <a href="#functions next">next() and prior()</a></li>
<li>Class <a href="#Class noncopyable">noncopyable</a></li> <li>Class <a href="#Class noncopyable">noncopyable</a></li>
<li>Function template <a href="tie.html">tie()</a> and supporting class tied.</li>
</ul> </ul>
<h2>Template <a name="functions next">functions next</a>() and prior()</h2> <h2> <a name="functions next">Function</a> templates next() and prior()</h2>
<p>Certain data types, such as the C++ Standard Library's forward and <p>Certain data types, such as the C++ Standard Library's forward and
bidirectional iterators, do not provide addition and subtraction via operator+() bidirectional iterators, do not provide addition and subtraction via operator+()
@ -92,7 +93,7 @@ destructor declarations. He says &quot;Probably this concern is misplaced, becau
noncopyable will be used mostly for classes which own resources and thus have non-trivial destruction semantics.&quot;</p> noncopyable will be used mostly for classes which own resources and thus have non-trivial destruction semantics.&quot;</p>
<hr> <hr>
<p>Revised&nbsp; <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan <p>Revised&nbsp; <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan
-->26 January, 2000<!--webbot bot="Timestamp" endspan i-checksum="38194" -->28 September, 2000<!--webbot bot="Timestamp" endspan i-checksum="39343"
--> -->
</p> </p>
<p>© Copyright boost.org 1999. Permission to copy, use, modify, sell and <p>© Copyright boost.org 1999. Permission to copy, use, modify, sell and