Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69116 - in branches/release/libs/mpl/doc: refmanual src/refmanual
From: agurtovoy_at_[hidden]
Date: 2011-02-21 04:41:48


Author: agurtovoy
Date: 2011-02-21 04:41:45 EST (Mon, 21 Feb 2011)
New Revision: 69116
URL: http://svn.boost.org/trac/boost/changeset/69116

Log:
Closing ticket #816
Text files modified:
   branches/release/libs/mpl/doc/refmanual/set.html | 22 +++++++++++++++++-----
   branches/release/libs/mpl/doc/src/refmanual/set.rst | 24 ++++++++++++++++++++++--
   2 files changed, 39 insertions(+), 7 deletions(-)

Modified: branches/release/libs/mpl/doc/refmanual/set.html
==============================================================================
--- branches/release/libs/mpl/doc/refmanual/set.html (original)
+++ branches/release/libs/mpl/doc/refmanual/set.html 2011-02-21 04:41:45 EST (Mon, 21 Feb 2011)
@@ -12,7 +12,7 @@
 <td class="header-group page-location">Front Page / Sequences / Classes / set</td>
 </tr></table><div class="header-separator"></div>
 <div class="section" id="set">
-<h1><a class="toc-backref" href="./classes.html#id1409">set</a></h1>
+<h1><a class="toc-backref" href="./classes.html#id1410">set</a></h1>
 <div class="section" id="id72">
 <h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
 <p><tt class="literal"><span class="pre">set</span></tt> is a <a class="reference internal" href="./variadic-sequence.html">variadic</a>, <a class="reference internal" href="./associative-sequence.html">associative</a>, <a class="reference internal" href="./extensible-associative-sequence.html">extensible</a> sequence of types that
@@ -52,7 +52,8 @@
 <div class="section" id="id77">
 <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
 <p>In the following table, <tt class="literal"><span class="pre">s</span></tt> is an instance of <tt class="literal"><span class="pre">set</span></tt>, <tt class="literal"><span class="pre">pos</span></tt> is an iterator into <tt class="literal"><span class="pre">s</span></tt>,
-and <tt class="literal"><span class="pre">x</span></tt>, <tt class="literal"><span class="pre">k</span></tt>, and <em>t</em><sub>1</sub>,<em>t</em><sub>2</sub>,... <em>t</em><sub>n</sub> are arbitrary types.</p>
+and <tt class="literal"><span class="pre">x</span></tt>, <tt class="literal"><span class="pre">k</span></tt>, and <em>t</em><sub>1</sub>,<em>t</em><sub>2</sub>,... <em>t</em><sub>n</sub> is a set of <em>unique</em> arbitrary types. [<em>Note:</em> See <a class="reference internal" href="./set.html#nonunique-set-example">below</a> for
+an example of how to construct a <tt class="literal"><span class="pre">set</span></tt> from a list of potentially non-unique types — <em>end note</em>]</p>
 <table border="1" class="docutils table">
 <colgroup>
 <col width="40%" />
@@ -151,8 +152,9 @@
 </tbody>
 </table>
 </div>
-<div class="section" id="id78">
+<div class="section" id="id79">
 <h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
+<p>Basic <tt class="literal"><span class="pre">set</span></tt> invariants:</p>
 <pre class="literal-block">
 typedef set&lt; int,long,double,int_&lt;5&gt; &gt; s;
 
@@ -164,8 +166,18 @@
 <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; <a href="./at.html" class="identifier">at</a>&lt;s,<a href="./int.html" class="identifier">int_</a>&lt;5&gt; &gt;::type, <a href="./int.html" class="identifier">int_</a>&lt;5&gt; &gt; ));
 <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; <a href="./at.html" class="identifier">at</a>&lt;s,char&gt;::type, <a href="./void.html" class="identifier">void_</a> > ));
 </pre>
+<p id="nonunique-set-example">Constructing a <tt class="literal"><span class="pre">set</span></tt> from a list of potentially non-unique types:</p>
+<pre class="literal-block">
+typedef fold&lt;
+ vector&lt;int,int,long,long&gt;
+ , set0&lt;&gt;
+ , insert&lt;_1,_2&gt;
+ &gt;::type s;
+
+BOOST_MPL_ASSERT_RELATION( size&lt;s&gt;::value, ==, 2 );
+</pre>
 </div>
-<div class="section" id="id79">
+<div class="section" id="id80">
 <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
 <p><a class="reference internal" href="./sequences.html">Sequences</a>, <a class="reference internal" href="./variadic-sequence.html">Variadic Sequence</a>, <a class="reference internal" href="./associative-sequence.html">Associative Sequence</a>, <a class="reference internal" href="./extensible-associative-sequence.html">Extensible Associative Sequence</a>, <a class="reference internal" href="./set-c.html">set_c</a>, <a class="reference internal" href="./map.html">map</a>, <a class="reference internal" href="./vector.html">vector</a></p>
 <!-- Sequences/Classes//map |50 -->
@@ -174,7 +186,7 @@
 
 <div class="footer-separator"></div>
 <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group">Prev&nbsp;Next</span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Back&nbsp;Along</span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Up&nbsp;Home</span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Full TOC</span></td>
-<td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</div>
+<td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2011 Aleksey Gurtovoy and David Abrahams</div>
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt>)</div></td></tr></table></body>
 </html>

Modified: branches/release/libs/mpl/doc/src/refmanual/set.rst
==============================================================================
--- branches/release/libs/mpl/doc/src/refmanual/set.rst (original)
+++ branches/release/libs/mpl/doc/src/refmanual/set.rst 2011-02-21 04:41:45 EST (Mon, 21 Feb 2011)
@@ -37,7 +37,10 @@
 --------------------
 
 In the following table, ``s`` is an instance of ``set``, ``pos`` is an iterator into ``s``,
-and ``x``, ``k``, and |t1...tn| are arbitrary types.
+and ``x``, ``k``, and |t1...tn| is a set of *unique* arbitrary types. [*Note:* See `below`__ for
+an example of how to construct a ``set`` from a list of potentially non-unique types |--| *end note*\]
+
+__ nonunique-set-example_
 
 +---------------------------------------+-----------------------------------------------------------+
 | Expression | Semantics |
@@ -105,6 +108,8 @@
 Example
 -------
 
+Basic ``set`` invariants:
+
 .. parsed-literal::
 
     typedef set< int,long,double,int_<5> > s;
@@ -118,12 +123,27 @@
     BOOST_MPL_ASSERT(( is_same< at<s,char>::type, void\_ > ));
 
 
+.. _nonunique-set-example:
+
+Constructing a ``set`` from a list of potentially non-unique types:
+
+.. parsed-literal::
+
+ typedef fold<
+ vector<int,int,long,long>
+ , set0<>
+ , insert<_1,_2>
+ >::type s;
+
+ BOOST_MPL_ASSERT_RELATION( size<s>::value, ==, 2 );
+
+
 See also
 --------
 
 |Sequences|, |Variadic Sequence|, |Associative Sequence|, |Extensible Associative Sequence|, |set_c|, |map|, |vector|
 
 
-.. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
+.. copyright:: Copyright © 2001-2011 Aleksey Gurtovoy and David Abrahams
    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk