Compare commits

...

5 Commits

Author SHA1 Message Date
Marshall Clow ebe0e7b935 Release 1.55.0
[SVN r86621]
2013-11-11 19:45:21 +00:00
Beman Dawes 3e3b4aeef2 Merge 84443 from trunk, to fix mpl assert failures for msvc in many libraries.
[SVN r86514]
2013-10-29 13:15:03 +00:00
Steven Watanabe 6e78a8f0f4 Merge [81027] from the trunk.
[SVN r84442]
2013-05-23 14:38:22 +00:00
Aleksey Gurtovoy 161b05edfb Docs/cosmetic: fix td/th border style in Firefox
[SVN r69117]
2011-02-21 10:00:08 +00:00
Aleksey Gurtovoy 3a4c350910 Closing ticket #816
[SVN r69116]
2011-02-21 09:41:45 +00:00
9 changed files with 120 additions and 8 deletions
Executable → Regular
View File
+17 -5
View File
@@ -12,7 +12,7 @@
<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./sequences.html" class="navigation-link">Sequences</a> / <a href="./classes.html" class="navigation-link">Classes</a> / <a href="./set.html" class="navigation-link">set</a></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"><a href="./set.html" class="identifier">set</a></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 @@ A <tt class="literal"><span class="pre"><a href="./set.html" class="identifier">
<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"><a href="./set.html" class="identifier">set</a></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"><a href="./set.html" class="identifier">set</a></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 @@ the key <tt class="literal"><span class="pre">k</span></tt> in <tt class="litera
</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"><a href="./set.html" class="identifier">set</a></span></tt> invariants:</p>
<pre class="literal-block">
typedef <a href="./set.html" class="identifier">set</a>&lt; int,long,double,<a href="./int.html" class="identifier">int_</a>&lt;5&gt; &gt; s;
@@ -164,8 +166,18 @@ typedef <a href="./set.html" class="identifier">set</a>&lt; int,long,double,<a h
<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"><a href="./set.html" class="identifier">set</a></span></tt> from a list of potentially non-unique types:</p>
<pre class="literal-block">
typedef <a href="./fold.html" class="identifier">fold</a>&lt;
<a href="./vector.html" class="identifier">vector</a>&lt;int,int,long,long&gt;
, set0&lt;&gt;
, <a href="./insert.html" class="identifier">insert</a>&lt;<a href="./placeholders.html" class="identifier">_1</a>,<a href="./placeholders.html" class="identifier">_2</a>&gt;
&gt;::type s;
<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./size.html" class="identifier">size</a>&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 @@ typedef <a href="./set.html" class="identifier">set</a>&lt; int,long,double,<a h
<div class="footer-separator"></div>
<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./deque.html" class="navigation-link">Prev</a>&nbsp;<a href="./map.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./deque.html" class="navigation-link">Back</a>&nbsp;<a href="./map.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./classes.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></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</a>)</div></td></tr></table></body>
</html>
+22 -2
View File
@@ -37,7 +37,10 @@ Expression semantics
--------------------
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 @@ and ``x``, ``k``, and |t1...tn| are arbitrary types.
Example
-------
Basic ``set`` invariants:
.. parsed-literal::
typedef set< int,long,double,int_<5> > s;
@@ -118,12 +123,27 @@ Example
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)
+1
View File
@@ -644,6 +644,7 @@ td,
table.table
th
{
border: solid 1px #c7c7c7;
vertical-align: top;
}
Executable → Regular
View File
Executable → Regular
View File
+69 -1
View File
@@ -34,6 +34,9 @@
#include <boost/config.hpp> // make sure 'size_t' is placed into 'std'
#include <cstddef>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
#include <boost/mpl/if.hpp>
#endif
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|| (BOOST_MPL_CFG_GCC != 0) \
@@ -131,8 +134,38 @@ template< assert_::relations r, long x, long y > struct assert_relation {};
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
#if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
template<class Pred>
struct extract_assert_pred;
template<class Pred>
struct extract_assert_pred<void(Pred)> { typedef Pred type; };
template<class Pred>
struct eval_assert {
typedef typename extract_assert_pred<Pred>::type P;
typedef typename P::type p_type;
typedef typename ::boost::mpl::if_c<p_type::value,
AUX778076_ASSERT_ARG(assert<false>),
failed ************ P::************
>::type type;
};
template<class Pred>
struct eval_assert_not {
typedef typename extract_assert_pred<Pred>::type P;
typedef typename P::type p_type;
typedef typename ::boost::mpl::if_c<!p_type::value,
AUX778076_ASSERT_ARG(assert<false>),
failed ************ ::boost::mpl::not_<P>::************
>::type type;
};
template< typename T >
T make_assert_arg();
#elif !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
template< bool > struct assert_arg_pred_impl { typedef int type; };
template<> struct assert_arg_pred_impl<true> { typedef void* type; };
@@ -211,6 +244,39 @@ assert_rel_arg( assert_relation<r,x,y> );
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
#if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
// BOOST_MPL_ASSERT((pred<x,...>))
#define BOOST_MPL_ASSERT(pred) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<false>( \
boost::mpl::make_assert_arg< \
typename boost::mpl::eval_assert<void pred>::type \
>() \
) \
) \
) \
/**/
// BOOST_MPL_ASSERT_NOT((pred<x,...>))
#define BOOST_MPL_ASSERT_NOT(pred) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<false>( \
boost::mpl::make_assert_arg< \
typename boost::mpl::eval_assert_not<void pred>::type \
>() \
) \
) \
) \
/**/
#else
// BOOST_MPL_ASSERT((pred<x,...>))
@@ -250,6 +316,8 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
/**/
#endif
#endif
// BOOST_MPL_ASSERT_RELATION(x, ==|!=|<=|<|>=|>, y)
#if defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
Executable → Regular
View File
+11
View File
@@ -71,6 +71,17 @@ struct her
}
};
template<class T>
struct nested : boost::mpl::true_ {
BOOST_MPL_ASSERT(( boost::is_pointer<T*> ));
BOOST_MPL_ASSERT_NOT(( boost::is_same<void,T> ));
BOOST_MPL_ASSERT_RELATION( sizeof(T*), >, 1 );
BOOST_MPL_ASSERT_MSG( true, GLOBAL_SCOPE_ERROR, (int,long) );
};
BOOST_MPL_ASSERT(( nested<int> ));
BOOST_MPL_ASSERT_NOT(( boost::mpl::not_<nested<unsigned> > ));
int main()
{
her<void> h;