This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.

[SVN r17837]
This commit is contained in:
nobody
2003-03-12 13:29:13 +00:00
parent ae4caa5180
commit 3d325c7333
12 changed files with 645 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Integral constant classes</title>
<link rel="stylesheet" href="./mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Integral constant classes</h1><h4>Concepts</h4>
<ul>
<li><a href="./Integral_Constant.html">Integral Constant</a>
</ul>
<p>
<h4>Types</h4>
<ul>
<li>integral_c
<li>bool_
<li>int_
<li>long_
<li>size_t
</ul>
<p><hr>
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:34 am</body></html>

View File

@@ -0,0 +1,67 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Metafunction Class</title>
<link rel="stylesheet" href="./mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Metafunction Class</h1><h3>Description</h3>
<p>
A <em>metafunction class</em> is a certain form of metafunction representation that enables higher-order metaprogramming. In particular, a non-nullary metafunction class is a type with a nested class template member <code>apply</code>. A nullary metafunction class has the form of a <a href="./Metafunction.html">nullary metafunction</a>. A metafunction class invocation is defined as invocation of its nested <code>apply</code> <a href="./Metafunction.html">metafunction</a>.
<p>
<h3>Valid expressions</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type &nbsp;</th></tr>
<tr><td><code>typename f::type</code></td><td>A type </td></tr>
<tr><td><code>typename f::template apply&lt;a1,..,an&gt;::type</code></td><td>A type </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Complexity&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typename f::type</code></td><td>unspecified</td><td><code>f</code> is a nullary metafunction class; <code>f::type</code> is a <em>type-name</em></td><td><code>f::type</code> is the result of the metafunction class invocation</td><td></td></tr>
<tr><td><code>typename f::template apply&lt;a1,..,an&gt;::type</code></td><td>unspecified</td><td><code>f</code> is an <code>n</code>-ary metafunction class; <code>apply</code> is a <a href="./Metafunction.html">metafunction</a></td><td><code>typename f::template apply&lt;a1,..,an&gt;::type</code> is the result of the metafunction class invocation with the actual arguments <code>a1,..,an</code></td><td></td></tr>
</table>
<p>
<p>
<h3>Example</h3>
<p>
<pre>
<span class="cxx-comment">// nullary metafunction class</span>
struct always_true { typedef true_ type; };
<p>
template&lt; long N &gt; struct le
{
template&lt; typename M &gt; struct apply
{
typedef bool_&lt; (M::value &lt; N) &gt; type;
};
};
<p>
<span class="cxx-comment">// unary metafunction class</span>
typedef le&lt;5&gt; less_than_5;
<p>
<span class="cxx-comment">// binary metafunction class</span>
struct less_than
{
template&lt; typename N1, typename N2 &gt; struct apply
{
typedef bool_&lt; (N1::value &lt; N2::value) &gt; type;
};
};
<p>
<span class="cxx-comment">// invocations</span>
typedef always_true::type t1;
typedef less_than_5::apply&lt; int_&lt;7&gt; &gt;::type t2;
typedef less_than::apply&lt; int_&lt;5&gt;,int_&lt;7&gt; &gt;::type t3;
<p>
<span class="cxx-comment">// results checks</span>
BOOST_STATIC_ASSERT(t1::value);
BOOST_STATIC_ASSERT(!t2::value);
BOOST_STATIC_ASSERT(t3::value);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="./Metafunctions.html">Metafunctions</a>, <a href="./Metafunction.html">Metafunction</a>
<p><hr>
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 4:16 am</body></html>

View File

@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::and_</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>and_</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F1
, typename F2
, typename F3 = true_
...
, typename Fn = true_
&gt;
struct and_
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of short-circuit <em>logical and</em> (<code>&amp;&amp;</code>) operation on its arguments.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/and.hpp">boost/mpl/and.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>F1, F2, .., Fn</code></td><td>A model of nullary <a href="../Metafunction.html">Metafunction</a></td><td></td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef and_&lt;f1,f2,..,fn&gt;::type c;</code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Returns <code>false_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to <code>false</code>, and <code>true_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to <code>false</code> are not evaluated.</td><td></td></tr>
</table>
<p>
<h3>Example</h3>
<p>
<pre>
<span class="cxx-comment">// will generate compile-time error if invoked with T == any fundamental type</span>
template&lt; typename T &gt; struct fail
{
typedef typename T::nonexistent type;
};
<p>
BOOST_STATIC_ASSERT((and_&lt; true_,false_ &gt;::type::value == false));
BOOST_STATIC_ASSERT((and_&lt; false_,fail&lt;int&gt; &gt;::type::value == false)); <span class="cxx-comment">// OK, fail&lt;int&gt; is never invoked</span>
BOOST_STATIC_ASSERT((and_&lt; true_,false_,fail&lt;int&gt; &gt;::type::value == false)); <span class="cxx-comment">// OK too</span>
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/or.html">or_</a></code>, <code><a href="../Reference/not.html">not_</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:21 am</body></html>

View File

@@ -0,0 +1,56 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::deref</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>deref</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Iterator
&gt;
struct deref
{
typedef typename Iterator::type type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Dereferences an iterator.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/deref.hpp">boost/mpl/deref.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Iterator</code></td><td>A model of <a href="../Trivial_Iterator.html">Trivial Iterator</a></td><td>An iterator to be dereferenced. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef deref&lt;Iterator&gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef Iterator::type t;</code>.</td><td><code>Iterator</code> is dereferenceable </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;char,short,int,long&gt; types;
typedef <a href="../Reference/begin.html">begin</a>&lt;types&gt;::type iter;
BOOST_STATIC_ASSERT(boost::is_same&lt; deref&lt;iter&gt;::type,char &gt;::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <code><a href="../Reference/begin.html">begin</a>/<a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:30 am</body></html>

View File

@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::joint_view</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>joint_view</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence1
, typename Sequence2
&gt;
struct joint_view
{
<span class="cxx-comment">// unspecified</span>
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>joint_view</code> is a two-sequence view that allows one to operate on a sequence of concatenated elements of sequences <code>Sequence1</code> and <code>Sequence2</code> without actually creating one.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/joint_view.hpp">boost/mpl/joint_view.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Sequence1</code>, <code>Sequence2</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>Sequences to concatenate. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef joint_view&lt;Sequence1,Sequence2&gt; s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> prodives iterators to all the elements in the ranges <code>[<a href="../Reference/begin.html">begin</a>&lt;Sequence1&gt;::type,<a href="../Reference/end.html">end</a>&lt;Sequence1&gt;::type)</code>, <code>[<a href="../Reference/begin.html">begin</a>&lt;Sequence2&gt;::type,<a href="../Reference/end.html">end</a>&lt;Sequence2&gt;::type)</code>.</td><td><code><a href="../Reference/size.html">size</a>&lt;s&gt;::type::value == <a href="../Reference/size.html">size</a>&lt; Sequence1 &gt;::type::value + <a href="../Reference/size.html">size</a>&lt; Sequence2 &gt;::type::value</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef joint_view&lt;
<a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt;
, <a href="../Reference/range_c.html">range_c</a>&lt;int,10,15&gt;
&gt; numbers;
<p>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;int,0,15&gt; answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt;numbers,answer&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:42 am</body></html>

View File

@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::max_element</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>max_element</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred = <a href="../Reference/less.html">less</a>&lt;_1,_2&gt;
&gt;
struct max_element
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Finds the largest element in the <code>Sequence</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/max_element.hpp">boost/mpl/max_element.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Forward_Sequence.html">Forward Sequence</a></td><td>A sequence to be searched. </td></tr>
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A comparison criteria. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef max_element&lt; Sequence,Pred &gt;::type i;</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td></td><td><code>i</code> is the first iterator in <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> such that for every iterator <code>j</code> in <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code>, <code>apply&lt; lambda&lt;Pred&gt;::type, i::type, j::type &gt;::type::value == false</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Zero comparisons if <code>Sequence</code> is empty, otherwise exactly <code>size&lt;Sequence&gt;::value - 1</code> comparisons.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;int,char[50],long,double&gt; types;
typedef max_element&lt;
<a href="../Reference/transform_view.html">transform_view</a>&lt; types,sizeof_&lt;_1&gt; &gt;
&gt;::type iter;
<p>
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>&lt; begin&lt;types&gt;::type,iter &gt;::type::value == 1));
BOOST_STATIC_ASSERT(sizeof(<a href="../Reference/deref.html">deref</a>&lt;iter&gt;::type) == 50);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/min_element.html">min_element</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:01 am</body></html>

View File

@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::min_element</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>min_element</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred = <a href="../Reference/less.html">less</a>&lt;_1,_2&gt;
&gt;
struct min_element
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Finds the smallest element in the <code>Sequence</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/min_element.hpp">boost/mpl/min_element.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Forward_Sequence.html">Forward Sequence</a></td><td>A sequence to be searched. </td></tr>
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A comparison criteria. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef min_element&lt; Sequence,Pred &gt;::type i;</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td></td><td><code>i</code> is the first iterator in <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> such that for every iterator <code>j</code> in <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code>, <code>apply&lt; lambda&lt;Pred&gt;::type, j::type, i::type &gt;::type::value == false</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Zero comparisons if <code>Sequence</code> is empty, otherwise exactly <code>size&lt;Sequence&gt;::value - 1</code> comparisons.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;bool,char[50],long,double&gt; types;
typedef min_element&lt;
<a href="../Reference/transform_view.html">transform_view</a>&lt; types,sizeof_&lt;_1&gt; &gt;
&gt;::type iter;
<p>
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>&lt; begin&lt;types&gt;::type,iter &gt;::type::value == 0));
BOOST_STATIC_ASSERT(sizeof(<a href="../Reference/deref.html">deref</a>&lt;iter&gt;::type) == sizeof(bool));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/max_element.html">max_element</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:05 am</body></html>

View File

@@ -0,0 +1,51 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::not_</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>not_</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F
&gt;
struct not_
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of <em>logical not</em> (<code>!</code>) operation on its argument.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/not.hpp">boost/mpl/not.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>F</code></td><td>A model of nullary <a href="../Metafunction.html">Metafunction</a></td><td></td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef not_&lt;f&gt;::type c;</code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef bool_&lt;(!f::type::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Example</h3>
<p>
<pre>
BOOST_STATIC_ASSERT(not_&lt;true_&gt;::type::value == false);
BOOST_STATIC_ASSERT(not_&lt;false_&gt;::type::value == true);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/and.html">and_</a></code>, <code><a href="../Reference/or.html">or_</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:19 am</body></html>

62
doc/ref/Reference/or.html Normal file
View File

@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::or_</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>or_</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F1
, typename F2
, typename F3 = false_
...
, typename Fn = false_
&gt;
struct or_
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of short-circuit <em>logical or</em> (<code>||</code>) operation on its arguments.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/or.hpp">boost/mpl/or.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>F1, F2, .., Fn</code></td><td>A model of nullary <a href="../Metafunction.html">Metafunction</a></td><td></td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef or_&lt;f1,f2,..,fn&gt;::type c;</code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Returns <code>true_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to true, and <code>false_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to true are not evaluated.</td><td></td></tr>
</table>
<p>
<h3>Example</h3>
<p>
<pre>
<span class="cxx-comment">// will generate compile-time error if invoked with T == any fundamental type</span>
template&lt; typename T &gt; struct fail
{
typedef typename T::nonexistent type;
};
<p>
BOOST_STATIC_ASSERT((or_&lt; false_,true_ &gt;::type::value == true));
BOOST_STATIC_ASSERT((or_&lt; true_,fail&lt;int&gt; &gt;::type::value == true)); <span class="cxx-comment">// OK, fail&lt;int&gt; is never invoked</span>
BOOST_STATIC_ASSERT((or_&lt; false_,true_,fail&lt;int&gt; &gt;::type::value == true)); <span class="cxx-comment">// OK too</span>
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/and.html">and_</a></code>, <code><a href="../Reference/not.html">not_</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:18 am</body></html>

View File

@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::single_view</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>single_view</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T
&gt;
struct single_view
{
<span class="cxx-comment">// unspecified</span>
};
</pre>
<p>
<h3>Description</h3>
<p>
Allows one to represent an arbitrary type <code>T</code> as a single-element sequence.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/single_view.hpp">boost/mpl/single_view.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>T</code></td><td>A type</td><td>The type to be wrapped in a sequence. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef single_view&lt;T&gt; s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> is a random-access, single-element sequence such as <code><a href="../Reference/front.html">front</a>&lt;s&gt;::type</code> is identical to <code>T</code></td><td><code><a href="../Reference/size.html">size</a>&lt;s&gt;::type::value == 1, boost::same_as&lt;<a href="../Reference/front.html">front</a>&lt;s&gt;::type,T&gt;::value == true</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef single_view&lt;int&gt; view;
typedef <a href="../Reference/begin.html">begin</a>&lt;view&gt;::type first;
typedef <a href="../Reference/end.html">end</a>&lt;view&gt;::type last;
<p>
BOOST_MPL_ASSERT_IS_SAME(first::type,int);
BOOST_MPL_ASSERT_IS_SAME(first::next,last);
BOOST_MPL_ASSERT_IS_SAME(last::prior,first);
<p>
BOOST_STATIC_ASSERT(size&lt;view&gt;::type::value == 1);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/joint_view.html">joint_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:19 am</body></html>

View File

@@ -0,0 +1,66 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::zip_view</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>zip_view</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequences
&gt;
struct zip_view
{
<span class="cxx-comment">// unspecified</span>
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>zip_view</code> provides a "zipped" view onto several sequences; that is, it allows to represent several sequences as a single sequence of elements each of those, in its turn, is a sequence of the corresponding <code>Sequences</code> elements.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/zip_view.hpp">boost/mpl/zip_view.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>Sequences</code></td><td>A <a href="../Sequence.html">Sequence</a> of <a href="../Sequence.html">Sequence</a>s</td><td>Sequences to be "zipped". </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef zip_view&lt;Sequences&gt; s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> is a sequence such that for each <code>i</code> in <code>[<a href="../Reference/begin.html">begin</a>&lt;s&gt;::type, <a href="../Reference/end.html">end</a>&lt;s&gt;::type)</code> and for each <code>j</code> in <code>[<a href="../Reference/begin.html">begin</a>&lt;Sequences&gt;::type, <a href="../Reference/end.html">end</a>&lt;Sequences&gt;::type)</code> <code>i::type</code> is identical to <code><a href="../Reference/transform.html">transform</a>&lt;j::type, <a href="../Reference/deref.html">deref</a>&lt;_1&gt; &gt;::type </code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt; s1;
typedef range_c&lt;int,10,20&gt; s2;
<p>
typedef <a href="../Reference/transform_view.html">transform_view</a>&lt;
<a href="../Reference/zip_view.html">zip_view</a>&lt; <a href="../Reference/list.html">list</a>&lt;s1,s2&gt; &gt;
, apply_seq&lt; <a href="../Reference/plus.html">plus</a>&lt;_1,_2&gt; &gt;
&gt; result;
<p>
BOOST_STATIC_ASSERT((equal&lt;
result
, <a href="../Reference/filter_view.html">filter_view</a>&lt; range_c&lt;int,10,30&gt;, math::is_even&lt;_1&gt; &gt;
, <a href="../Reference/equal_to.html">equal_to</a>&lt;_1,_2&gt;
&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/joint_view.html">joint_view</a></code>, <code><a href="../Reference/equal.html">equal</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:04 am</body></html>

View File

@@ -0,0 +1,15 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Table of Contents</title>
<link rel="stylesheet" href="./mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Table of Contents</h1><ol>
<li><a href="./Sequences.html">Sequences</a>
<li><a href="./Iterators.html">Iterators</a>
<li><a href="./Algorithms.html">Algorithms</a>
<li><a href="./Metafunctions.html">Metafunctions</a>
<li><a href="./Integral_constant_classes.html">Integral constant classes</a>
<li><a href="./Categorized_index.html">Categorized index</a>
<li><a href="./Acknowledgements.html">Acknowledgements</a>
</ol>
<p><hr>
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:32 am</body></html>