Added libs/mpl

[SVN r15384]
This commit is contained in:
Dave Abrahams committed 2002-09-16 19:25:33 +00:00
1 parent 6ec072c403
commit 01d61922bc
238 files changed
+15885

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/advance</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>advance</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Iterator
, typename N
&gt;
struct advance
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns an new iterator <code>i</code> such as <code>distance&lt; Iterator,i &gt;::type::value == N::value</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/advance.hpp">boost/mpl/advance.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="../Input_Iterator.html">Input Iterator</a></td><td></td></tr>
<tr><td><code>N</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 advance&lt;Iterator,N&gt;::type i;</code></td><td>A model of <a href="../Input_Iterator.html">Input Iterator</a></td><td><code>Iterator</code> and every iterator between <code>Iterator</code> and <code>i</code> (inclusive) is nonsingular; <code>N::value</code> must be nonnegative if <code>Iterator</code> is a model of <a href="../Input_Iterator.html">Input Iterator</a> or <a href="../Forward_Iterator.html">Forward Iterator</a></td><td>Equivalent to <code>typedef Iterator::next i1; typedef i1::next i2; .. typedef in-1::next i;</code> if <code>N::value &gt; 0</code>, and <code>typedef Iterator::prior i1; typedef i1::prior i2; .. typedef in-1::prior i;</code> otherwise; if <code>N::value == 0</code>, the algorithm has no effect.</td><td><code>distance&lt; Iterator,i &gt;::type::value == N::value</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time if <code>Iterator</code> is a model of <a href="../Random_Access_Iterator.html">Random Access Iterator</a>, otherwise linear time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef vector_c&lt;int,0,1,2,3,4,5,6,7,8,9&gt; numbers;
typedef begin&lt;numbers&gt;::type first;
typedef end&lt;numbers&gt;::type last;
typedef advance_c&lt;first,10&gt;::type iter1;
typedef advance_c&lt;last,-10&gt;::type iter2;
BOOST_MPL_ASSERT_IS_SAME(iter1, last);
BOOST_MPL_ASSERT_IS_SAME(iter2, first);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/distance.html">distance</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 6:38 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/at</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>at</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename N
, typename Sequence
&gt;
struct at
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a type identical to the <code>N</code>-th element from the beginning of the sequence.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/at.hpp">boost/mpl/at.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>N</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td>The offset from the beginning of the sequence that specifies the element to be retrieved. </td></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 examined. </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 at&lt;N,Sequence&gt;::type t;</code></td><td>A type</td><td><code>0 &lt;= N::value &lt; size&lt;Sequence&gt;::type::value</code></td><td>Equivalent to <code>typedef advance&lt; begin&lt;Sequence&gt;::type,N &gt;::type::type t;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Depends on the implementation of the particular sequence it is applied to. Linear in the worst case, or amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;long,10,50&gt; range;
BOOST_STATIC_ASSERT(at&lt; int_c&lt;0&gt;, range &gt;::type::value == 10);
BOOST_STATIC_ASSERT(at&lt; int_c&lt;10&gt;, range &gt;::type::value == 20);
BOOST_STATIC_ASSERT(at&lt; int_c&lt;40&gt;, range &gt;::type::value == 50);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Forward_Sequence.html">Forward Sequence</a>, <code><a href="../Reference/at_c.html">at_c</a></code>, <code><a href="../Reference/front.html">front</a></code>, <code><a href="../Reference/back.html">back</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:49 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/at c</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>at_c</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
long n
, typename Sequence
&gt;
struct at_c
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a type identical to the <code>n</code>-th element from the beginning of the sequence. <code>at_c&lt;n,Sequence&gt;::type</code> is a shorcut notation for <code>at&lt; integral_c&lt;long,n&gt;, Sequence&gt;::type</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/at.hpp">boost/mpl/at.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>n</code></td><td>An compile-time integral constant</td><td>An offset from the beginning of the sequence that specifies the element to be retrieved. </td></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Forward_Sequence.html">Forward Sequence</a></td><td>A sequence being examined. </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 at_c&lt;n,Sequence&gt;::type t;</code></td><td>A type</td><td><code>0 &lt;= n &lt; size&lt;Sequence&gt;::type::value</code></td><td>Equivalent to <code>typedef at&lt; integral_c&lt;long,n&gt;, Sequence&gt;::type t;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Depends on the implementation of the particular sequence it is applied to. Linear in the worst case, or amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;long,10,50&gt; range;
BOOST_STATIC_ASSERT(at_c&lt;0,range&gt;::type::value == 10);
BOOST_STATIC_ASSERT(at_c&lt;10,range&gt;::type::value == 20);
BOOST_STATIC_ASSERT(at_c&lt;40,range&gt;::type::value == 50);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Forward_Sequence.html">Forward Sequence</a>, <code><a href="../Reference/at.html">at</a></code>, <code><a href="../Reference/front.html">front</a></code>, <code><a href="../Reference/back.html">back</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:50 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/back</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>back</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct back
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a type identical to the last element in the sequence, that is, the element in a position that preceeds the position of past-the-end iterator.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/back.hpp">boost/mpl/back.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 examined. </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 back&lt;Sequence&gt;::type t;</code></td><td>A type</td><td><code>empty&lt;Sequence&gt;::type::value == false</code></td><td>Equivalent to <code>typedef prior&lt; end&lt;Sequence&gt;::type &gt;::type::type t;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/range_c.html">range_c</a>&lt;int,0,1&gt; range1;
typedef range_c&lt;int,0,10&gt; range2;
typedef range_c&lt;int,-10,0&gt; range3;
<p>
BOOST_STATIC_ASSERT(back&lt;range1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(back&lt;range2&gt;::type::value == 9);
BOOST_STATIC_ASSERT(back&lt;range3&gt;::type::value == -1);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Forward_Sequence.html">Forward Sequence</a>, <code><a href="../Reference/front.html">front</a></code>, <code><a href="../Reference/at.html">at</a></code>, <code><a href="../Reference/end.html">end</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:47 am</body></html>
+56
View File
@@ -0,0 +1,56 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/begin</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>begin</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct begin
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns an iterator that points to the first element of the sequence.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/begin_end.hpp">boost/mpl/begin_end.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="../Sequence.html">Sequence</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 begin&lt;Sequence&gt;::type first;</code></td><td>A model of <a href="../Input_Iterator.html">Input Iterator</a></td><td></td><td><code>first</code> is an iterator pointing to the first element of the <code>Sequence</code>; equivalent to <code>Sequence::begin</code> unless the algorithm has been specialized for the particular type of sequence.</td><td><code>first</code> is either dereferenceable or past-the-end; it is past-the-end if and only if <code>size&lt;Sequence&gt;::type::value == 0</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef vector&lt;unsigned char,unsigned short,unsigned int, unsigned long&gt; unsigned_types;
typedef begin&lt;unsigned_types&gt;::type iter;
BOOST_STATIC_ASSERT((boost::is_same&lt;iter::type,unsigned char&gt;::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/end.html">end</a></code>, <code><a href="../Reference/size.html">size</a></code>, <code><a href="../Reference/empty.html">empty</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 22, 2002 2:03 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/clear</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>clear</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct clear
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns an empty sequence that preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/clear.hpp">boost/mpl/clear.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="../Extensible_Sequence.html">Extensible Sequence</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 clear&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef erase&lt;Sequence, begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type&gt;::type s;</code></td><td><code>empty&lt;s&gt;::type::value == true</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef list_c&lt;int,1,3,5,7,9,11&gt; odds;
typedef clear&lt;odds&gt;::type nothing;
BOOST_STATIC_ASSERT(empty&lt;nothing&gt;::type::value);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code><a href="../Reference/empty.html">empty</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:58 am</body></html>
+58
View File
@@ -0,0 +1,58 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/contains</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>contains</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct contains
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if one or more elements in <code>Sequence</code> are identical to <code>T</code>, and <code>false_c</code> otherwise.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/contains.hpp">boost/mpl/contains.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 examined. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The type to search for. </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 contains&lt;Sequence,T&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 <a href="../Reference/logical_not.html">logical_not</a>&lt; is_same&lt; <a href="../Reference/find.html">find</a>&lt;Sequence,T&gt;::type, <a href="../Reference/end.html">end</a>&lt;Sequence&gt;::type &gt; &gt;::type c</code>; </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. At most <code>size&lt;Sequence&gt;::value</code> comparisons for identity.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;char,int,unsigned,long,unsigned long&gt; types;
typedef contains&lt;types,bool&gt;::type result;
BOOST_STATIC_ASSERT(!result::value);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/find.html">find</a></code>, <code><a href="../Reference/find_if.html">find_if</a></code>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/count_if.html">count_if</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:48 am</body></html>
+70
View File
@@ -0,0 +1,70 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/copy</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>copy</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BinaryOp
&gt;
struct copy
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>copy</code> is, in fact, just another name for <code><a href="../Reference/fold.html">fold</a></code>. It was introduced for symmetry with <code><a href="../Reference/copy_if.html">copy_if</a></code> [<a href="#1">1</a>], and because it's a nice name for one of the typical <code>fold</code> applications, that is, copying the content of one sequence into another - see the example below.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/copy.hpp">boost/mpl/copy.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BinaryOp</code> application. </td></tr>
<tr><td><code>BinaryOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal. </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 copy&lt;Sequence,T,Op&gt;::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold&lt; Sequence,T,Op &gt;::type s;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BinaryOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector_c.html">vector_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt; numbers;
typedef copy&lt;
<a href="../Reference/range_c.html">range_c</a>&lt;int,10,20&gt;
, <a href="../Reference/push_back.html">push_back</a>&lt;_,_&gt;
, numbers
&gt;::type result;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result&gt;::value == 20);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; result,<a href="../Reference/range_c.html">range_c</a>&lt;int,0,20&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] In case if you wonder why <code><a href="../Reference/copy_if.html">copy_if</a></code>, in its turn, wasn't just called <code>fold_if</code>, - something that would allow to eliminate the family of <code>copy</code> algorithms completely - these two have quite different semantics.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/copy_if.html">copy_if</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>, <code><a href="../Reference/copy_backward_if.html">copy_backward_if</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 2:10 am</body></html>
+70
View File
@@ -0,0 +1,70 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/copy backward</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>copy_backward</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BinaryOp
&gt;
struct copy_backward
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>copy_backward</code> is, in fact, just another name for <code><a href="../Reference/fold_backward.html">fold_backward</a></code>. It was introduced for symmetry with <code><a href="../Reference/copy_backward_if.html">copy_backward_if</a></code> [<a href="#1">1</a>], and because it's a nice name for one of the typical <code>fold_backward</code> applications, that is, copying the content of one sequence into another - see the example below.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/copy_backward.hpp">boost/mpl/copy_backward.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BinaryOp</code> application. </td></tr>
<tr><td><code>BinaryOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on backward traversal. </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 copy_backward&lt;Sequence,T,Op&gt;::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold_backward&lt; Sequence,T,Op &gt;::type s;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BinaryOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,10,11,12,13,14,15,16,17,18,19&gt;::type numbers;
typedef copy_backward&lt;
<a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt;
, <a href="../Reference/push_front.html">push_front</a>&lt;_,_&gt;
, numbers
&gt;::type result;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result&gt;::value == 20);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; result,<a href="../Reference/range_c.html">range_c</a>&lt;int,0,20&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] In case if you wonder why <code><a href="../Reference/copy_backward_if.html">copy_backward_if</a></code>, in its turn, wasn't just called <code>fold_backward_if</code>, - something that would allow to eliminate the family of <code>copy_backward</code> algorithms completely - these two have quite different semantics.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/copy_backward_if.html">copy_backward_if</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_if.html">copy_if</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 2:11 am</body></html>
+70
View File
@@ -0,0 +1,70 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/copy backward if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>copy_backward_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BinaryOp
, typename Pred
&gt;
struct copy_backward_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of <code>BinaryOp</code> to the result of the previous <code>BinaryOp</code> invocation (<code>State</code> if it's the first call) and every element in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> that satisfies the predicate <code>Pred</code>, in the reverse order. A typical application for <code>copy_backward_if</code> is to conditionally copy the content of one sequence into another - see the example below.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/copy_backward_if.hpp">boost/mpl/copy_backward_if.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BinaryOp</code> application. </td></tr>
<tr><td><code>BinaryOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on backward traversal. </td></tr>
<tr><td><code>Pred</code></td><td>An unary Predicate [Lambda Expression]</td><td>The copying condition. </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 copy_backward_if&lt;Sequence,T,Op,Pred&gt;::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;Op&gt;::type op; typedef lambda&lt;Pred&gt;::type pred; typedef fold_backward&lt; Sequence,T,if_&lt; apply&lt;pred,_2&gt;, apply&lt;op,_1,_2&gt;, _1 &gt; &gt;::type s;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BinaryOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt;::type numbers;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4&gt;::type answer;
typedef copy_backward_if&lt;
numbers
, <a href="../Reference/list_c.html">list_c</a>&lt;int&gt;
, <a href="../Reference/push_front.html">push_front</a>&lt;_,_&gt;
, <a href="../Reference/less.html">less</a>&lt;_,int_c&lt;5&gt; &gt;
&gt;::type result;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result&gt;::value == 5);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt;result,answer&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>, <code><a href="../Reference/copy_if.html">copy_if</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 2:09 am</body></html>
+70
View File
@@ -0,0 +1,70 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/copy if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>copy_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BinaryOp
, typename Pred
&gt;
struct copy_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of <code>BinaryOp</code> to the result of the previous <code>BinaryOp</code> invocation (<code>State</code> if it's the first call) and every element in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> that satisfies the predicate <code>Pred</code>, in the linear order. A typical application for <code>copy_if</code> is to conditionally copy the content of one sequence into another - see the example below.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/copy_if.hpp">boost/mpl/copy_if.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BinaryOp</code> application. </td></tr>
<tr><td><code>BinaryOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal. </td></tr>
<tr><td><code>Pred</code></td><td>An unary Predicate [Lambda Expression]</td><td>The copying condition. </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 copy_if&lt;Sequence,T,Op,Pred&gt;::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;Op&gt;::type op; typedef lambda&lt;Pred&gt;::type pred; typedef fold&lt; Sequence,T,if_&lt; apply&lt;pred,_2&gt;, apply&lt;op,_1,_2&gt;, _1 &gt; &gt;::type s;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BinaryOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt;::type numbers;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4&gt;::type answer;
typedef copy_if&lt;
numbers
, <a href="../Reference/vector_c.html">vector_c</a>&lt;int&gt;
, <a href="../Reference/push_back.html">push_back</a>&lt;_,_&gt;
, <a href="../Reference/less.html">less</a>&lt;_,int_c&lt;5&gt; &gt;
&gt;::type result;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result&gt;::value == 5);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt;result,answer&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_backward_if.html">copy_backward_if</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/iter_fold.html">iter_fold</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 2:10 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/count</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>count</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct count
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the number of elements in a <code>Sequence</code> that are identical to <code>T</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/count_if.hpp">boost/mpl/count_if.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 examined. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The type to be searched for. </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 count&lt;Sequence,T&gt;::type n;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef <a href="../Reference/count_if.html">count_if</a>&lt; Sequence,is_same&lt;_,T&gt; &gt;::type n;</code></td><td></td></tr>
</table>
<p>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::value</code> comparisons for identity.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,char,long,short,char,short,double,long&gt; types;
typedef find&lt;types, short&gt;::type iter;
BOOST_STATIC_ASSERT((is_same&lt;iter::type,short&gt;::type::value));
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>&lt; begin&lt;types&gt;::type,iter &gt;::type::value == 3));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/count_if.html">count_if</a></code>, <code><a href="../Reference/find.html">find</a></code>, <code><a href="../Reference/find_if.html">find_if</a></code>, <code><a href="../Reference/contains.html">contains</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:32 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/count if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>count_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred
&gt;
struct count_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the number of elements in a <code>Sequence</code> that satisfy the predicate <code>Pred</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/count_if.hpp">boost/mpl/count_if.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 examined. </td></tr>
<tr><td><code>Pred</code></td><td>A model of Predicate [Lambda Expression]</td><td>The count condition. </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 count_if&lt;Sequence,Pred&gt;::type n;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code> typedef lambda&lt;Pred&gt;::type pred; typedef <a href="../Reference/fold.html">fold</a>&lt; Sequence,integral_c&lt;unsigned long,0&gt;,if_&lt;pred,<a href="../Reference/next.html">next</a>&lt;_1&gt;,_1&gt; &gt;::type n;</code></td><td></td></tr>
</table>
<p>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::value</code> applications of <code>Pred</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,char,long,short,char,long,double,long&gt; types;
<p>
BOOST_STATIC_ASSERT((count_if&lt; types,boost::is_float&lt;_&gt; &gt;::type::value == 1));
BOOST_STATIC_ASSERT((count_if&lt; types,boost::is_same&lt;_,char&gt; &gt;::type::value == 2));
BOOST_STATIC_ASSERT((count_if&lt; types,boost::is_same&lt;_,void&gt; &gt;::type::value == 0));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/find_if.html">find_if</a></code>, <code><a href="../Reference/find.html">find</a></code>, <code><a href="../Reference/contains.html">contains</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:32 am</body></html>
+56
View File
@@ -0,0 +1,56 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/distance</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>distance</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename First
, typename Last
&gt;
struct distance
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Finds the distance between <code>First</code> and <code>Last</code>, that is, an <a href="../Integral_Constant.html">Integral Constant</a> <code>D</code> such as <code>advance&lt; First,D &gt;::type</code> is identical to <code>Last</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/distance.hpp">boost/mpl/distance.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>First</code>, <code>Last</code></td><td>A model of <a href="../Input_Iterator.html">Input Iterator</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 distance&lt;First,Last&gt;::type d;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td><code>[First, Last)</code> is a valid range</td><td></td><td><code>is_same&lt; advance&lt; First,d &gt;::type, Last &gt;::value</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time if <code>Iterator</code> is a model of <a href="../Random_Access_Iterator.html">Random Access Iterator</a>, otherwise linear time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef range_c&lt;int,0,10&gt;::type range;
BOOST_STATIC_ASSERT((distance&lt; begin&lt;range&gt;::type,end&lt;range&gt;::type &gt;::type::value == 10));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/advance.html">advance</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 6:47 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/divides</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>divides</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
, typaname T3 = integral_c&lt;int,1&gt;
, ...
, typaname Tn = integral_c&lt;int,1&gt;
&gt;
struct divides
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the quotient of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/divides.hpp">boost/mpl/arithmetic/divides.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>T1, T2, .., Tn</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 divides&lt;t1,t2,..,tn&gt;::type quot;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td><code>t2::value != 0, t3::value != 0, .., tn::value != 0</code></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value / t2::value .. / tn::value), t1::value / t2::value .. / tn::value &gt; quot;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef divides&lt; integral_c&lt;short,-10&gt;, integral_c&lt;long,3&gt; &gt;::type quot;
BOOST_STATIC_ASSERT(quot::value == -3));
BOOST_MPL_ASSERT_IS_SAME(quot::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>divides</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:08 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/empty</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>empty</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct empty
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns an <a href="../Integral_Constant.html">Integral Constant</a> <code>c</code> such that <code>c::value == true</code> if and only if the sequence is empty.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/empty.hpp">boost/mpl/empty.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="../Sequence.html">Sequence</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 empty&lt;Sequence&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 is_same&lt; begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type &gt;::type c;</code></td><td></td></tr>
</table>
<p>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef range_c&lt;int,0,0&gt; empty_range;
typedef list&lt;long,float,double&gt; types;
<p>
BOOST_STATIC_ASSERT(empty&lt;empty_range&gt;::value)
BOOST_STATIC_ASSERT(!empty&lt;types&gt;::value)
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/size.html">size</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:52 am</body></html>
+57
View File
@@ -0,0 +1,57 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/end</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>end</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct end
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the past-the-end iterator to the sequence.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/begin_end.hpp">boost/mpl/begin_end.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="../Sequence.html">Sequence</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 end&lt;Sequence&gt;::type last;</code></td><td>A model of <a href="../Input_Iterator.html">Input Iterator</a></td><td></td><td><code>last</code> is an iterator pointing one past the last element in the <code>Sequence</code>; equivalent to <code>Sequence::end</code> unless the algorithm has been specialized for the particular type of sequence.</td><td><code>last</code> is past-the-end. </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;long&gt; short_list;
typedef <a href="../Reference/begin.html">begin</a>&lt;short_list&gt;::type first;
typedef end&lt;short_list&gt;::type last;
BOOST_STATIC_ASSERT((boost::is_same&lt;first::next,last&gt;::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/size.html">size</a></code>, <code><a href="../Reference/empty.html">empty</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 22, 2002 4:30 pm</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/equal</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>equal</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence1
, typename Sequence2
, typename Pred = is_same&lt;_,_&gt;
&gt;
struct equal
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if the two sequences <code>Sequence1</code> and <code>Sequence2</code> are identical when compared element-by-element, and otherwise returns <code>false_c</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/equal.hpp">boost/mpl/equal.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="../Forward_Sequence.html">Forward Sequence</a></td><td>Sequences to compare. </td></tr>
<tr><td><code>Pred</code></td><td>A binary Predicate [Lambda Expression]</td><td>The comparison metafunction. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef equal&lt;Sequence1,Sequence2,Pred&gt;::type c;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td><code>c::value == true</code> is and only if <code>size&lt;Sequence1&gt;::type::value == size&lt;Sequence2&gt;::type::value</code> and for every iterator <code>i</code> in <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> <code>i::type</code> is identical to <code>advance&lt; begin&lt;Sequence2&gt;::type, distance&lt; begin&lt;Sequence1&gt;::type,i &gt;::type &gt;::type</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. At most <code>size&lt;Sequence1&gt;::value</code> comparisons.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;char,int,unsigned,long,unsigned long&gt; s1;
typedef <a href="../Reference/list.html">list</a>&lt;char,int,unsigned,long,unsigned long&gt; s2;
BOOST_STATIC_ASSERT((equal&lt;s1,s2&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/count_if.html">count_if</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:54 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/equal to</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>equal_to</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct equal_to
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value == T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/equal_to.hpp">boost/mpl/comparison/equal_to.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 equal_to&lt;t1,t2&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_c&lt;(t1::value == t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,2,3,5,7,12,19,31&gt; fibonacci;
typedef <a href="../Reference/find_if.html">find_if</a>&lt; fibonacci, equal_to&lt;_,int_c&lt;12&gt; &gt; &gt;::type iter;
BOOST_STATIC_ASSERT(equal_to&lt; <a href="../Reference/distance.html">distance</a>&lt; <a href="../Reference/begin.html">begin</a>&lt;fibonacci&gt;::type, iter &gt;::type, int_c&lt;5&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>equal_to</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/not_equal_to.html">not_equal_to</a></code>, <code><a href="../Reference/less.html">less</a></code>, <code><a href="../Reference/less_equal.html">less_equal</a></code>, <code><a href="../Reference/greater.html">greater</a></code>, <code><a href="../Reference/greater_equal.html">greater_equal</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:13 am</body></html>
+65
View File
@@ -0,0 +1,65 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/erase</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>erase</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename First
, typename Last = typename First::next
&gt;
struct erase
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>erase</code> performs a removal of one or several consequent elements in the sequence starting from an arbitrary position. The algorithm returns a new sequence which contains all the elements in the ranges <code>[begin&lt;Sequence&gt;::type, First)</code> and <code>[Last, end&lt;Sequence&gt;::type)</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/erase.hpp">boost/mpl/erase.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><th>&nbsp;Default value &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the erase operation.</td><td></td></tr>
<tr><td><code>First</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td>Iterator to the beginning of the range to be erased.</td><td></td></tr>
<tr><td><code>Last</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td>Past-the-end iterator of the range to be erased.</td><td><code>typename First::next</code> </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef erase&lt;Sequence,pos&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>pos</code> is a dereferenceable iterator in <code>Sequence</code>.</td><td>Returns a new sequence which contains all the elements in the ranges <code>[begin&lt;Sequence&gt;::type, pos)</code> and <code>[next&lt;pos&gt;::type, end&lt;Sequence&gt;::type)</code>.</td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value - 1</code>; the relative order of the elements in <code>s</code> is the same as in <code>Sequence</code>. </td></tr>
<tr><td><code>typedef erase&lt;Sequence,first,last&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>[first,last)</code> is a valid range in <code>Sequence</code>.</td><td>Returns a new sequence which contains all the elements in the ranges <code>[begin&lt;Sequence&gt;::type, first)</code> and <code>[last, end&lt;Sequence&gt;::type)</code>.</td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value - distance&lt;first,last&gt;::type::value</code>; the relative order of the elements in <code>s</code> is the same as in <code>Sequence</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
The range form has linear complexity. The complexity of single-element erase is sequence dependent (linear in the worst case, or amortized constant time).
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,0,5,1,7,5,0,5&gt; values;
typedef <a href="../Reference/find.html">find</a>&lt; values, integral_c&lt;int,7&gt; &gt;::type pos;
typedef erase&lt;values,pos&gt;::type result_seq;
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result_seq&gt;::type::value == 7);
<p>
typedef find&lt;result, integral_c&lt;int,7&gt; &gt;::type result_iter;
BOOST_MPL_ASSERT_IS_SAME(result_iter, <a href="../Reference/end.html">end</a>&lt;result_seq&gt;::type);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/pop_front.html">pop_front</a></code>, <code><a href="../Reference/pop_back.html">pop_back</a></code>, <code><a href="../Reference/insert.html">insert</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:59 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/erase all</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>erase_all</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct erase_all
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/erase_all.hpp">boost/mpl/erase_all.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code><a href="../Reference/erase_if.html">erase_if</a></code>, <code><a href="../Reference/erase_range.html">erase_range</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 3:53 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/erase if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>erase_if</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Predicate
&gt;
struct erase_if
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/erase_if.hpp">boost/mpl/erase_if.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/erase_all.html">erase_all</a></code>, <code><a href="../Reference/erase_if.html">erase_if</a></code>, <code><a href="../Reference/erase_range.html">erase_range</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 3:54 am</body></html>
+63
View File
@@ -0,0 +1,63 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/erase range</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>erase_range</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename First
, typename Last
&gt;
struct erase_range
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/erase_range.hpp">boost/mpl/erase_range.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code>erase_all</code>, <code>erase_if</code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 3:55 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/filter view</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>filter_view</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred
&gt;
struct filter_view
{
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>filter_view</code> is a sequence wrapper that allows one to operate on the filtered sequence without actually creating one.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/filter_view.hpp">boost/mpl/filter_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>Sequence</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>A sequence to wrap. </td></tr>
<tr><td><code>Pred</code></td><td>A model of unary Predicate [Lambda Expression]</td><td>A filtering predicate. </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 filter_view&lt;Sequence,Pred&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 range <code>[<a href="../Reference/begin.html">begin</a>&lt;Sequence&gt;::type,<a href="../Reference/end.html">end</a>&lt;Sequence&gt;::type)</code> that satisfy the predicate <code>Pred</code>.</td><td><code><a href="../Reference/size.html">size</a>&lt;s&gt;::type::value == <a href="../Reference/count_if.html">count_if</a>&lt; Sequence,Pred &gt;::type::value</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
Finds the largest floating type in a sequence.
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,float,long,float,char[50],long double,char&gt; types;
typedef max_element&lt;
<a href="../Reference/transform_view.html">transform_view</a>&lt; filter_view&lt; types,boost::is_float&lt;_&gt; &gt;, size_of&lt;_&gt; &gt;
&gt;::type iter;
<p>
BOOST_STATIC_ASSERT((is_same&lt;iter::base::type,long double&gt;::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/list.html">list</a></code>, <code>max_element</code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 23, 2002 4:04 am</body></html>
+58
View File
@@ -0,0 +1,58 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/find</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>find</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct find
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Finds the first occurrence of type <code>T</code> in a <code>Sequence</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/find.hpp">boost/mpl/find.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 search in. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The type to search for. </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 find&lt;Sequence,T&gt;::type i;</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td></td><td>Equivalent to <code>typedef <a href="../Reference/find_if.html">find_if</a>&lt;Sequence, is_same&lt;_,T&gt; &gt;::type i</code>; </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. At most <code>size&lt;Sequence&gt;::value</code> comparisons for identity.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;char,int,unsigned,long,unsigned long&gt; types;
typedef find&lt;types,unsigned&gt;::type iter;
BOOST_STATIC_ASSERT(iter::position == 2);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/find_if.html">find_if</a></code>, <code><a href="../Reference/contains.html">contains</a></code>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/count_if.html">count_if</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:48 am</body></html>
+58
View File
@@ -0,0 +1,58 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/find if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>find_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred
&gt;
struct find_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Finds the first element in a <code>Sequence</code> that satisfies the predicate <code>Pred</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/find_if.hpp">boost/mpl/find_if.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 search in. </td></tr>
<tr><td><code>Pred</code></td><td>A model of Predicate [Lambda Expression]</td><td>A search condition. </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 find_if&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 the range <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> such that <code>apply&lt; lambda&lt;Pred&gt;::type,i::type &gt;::type::value == true</code>; <code>i</code> is identical to <code>end&lt;Sequence&gt;::type</code>, if no such iterator exists.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. At most <code>size&lt;Sequence&gt;::value</code> applications of <code>Pred</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;char,int,unsigned,long,unsigned_long&gt; types;
typedef find_if&lt;types, is_same&lt;_1,unsigned&gt; &gt;::type iter;
BOOST_STATIC_ASSERT(iter::position == 2);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/find.html">find</a></code>, <code><a href="../Reference/contains.html">contains</a></code>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/count_if.html">count_if</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:48 am</body></html>
+65
View File
@@ -0,0 +1,65 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/fold</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>fold</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename ForwardOp
&gt;
struct fold
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of binary <code>ForwardOp</code> to the result of the previous <code>ForwardOp</code> invocation (<code>State</code> if it's the first call) and every element of the sequence in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> in the linear order.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/fold.hpp">boost/mpl/fold.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>ForwardOp</code> application. </td></tr>
<tr><td><code>ForwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal. </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 fold&lt;Sequence,T,Op&gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;Op&gt;::type op; typedef iter_fold&lt; Sequence,T,apply&lt;op,_1,deref&lt;_2&gt; &gt; &gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>ForwardOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;long,float,short,double,float,long,long double&gt; types;
typedef typename fold&lt;
types
, integral_c&lt;long, 0&gt;
, if_&lt; is_float&lt;_2&gt;,<a href="../Reference/next.html">next</a>&lt;_1&gt;,_1 &gt;
&gt;::type number_of_floats;
<p>
BOOST_STATIC_ASSERT(number_of_floats::value == 3);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>, <code><a href="../Reference/iter_fold.html">iter_fold</a></code>, <code><a href="../Reference/iter_fold_backward.html">iter_fold_backward</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_if.html">copy_if</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 2:12 am</body></html>
+75
View File
@@ -0,0 +1,75 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/fold backward</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>fold_backward</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BackwardOp
, typename ForwardOp = _1
&gt;
struct fold_backward
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of binary <code>BackwardOp</code> to the result of the previous <code>BackwardOp</code> invocation (<code>State</code> if it's the first call) and every element in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> in the reverse order. If <code>ForwardOp</code> is provided, then it's applied on forward traversal to form the result which is passed to the first <code>BackwardOp</code> call.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/fold_backward.hpp">boost/mpl/fold_backward.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><th>&nbsp;Default value &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>A sequence to iterate.</td><td></td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BackwardOp</code>/<code>ForwardOp</code> application.</td><td></td></tr>
<tr><td><code>BackwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on backward traversal.</td><td></td></tr>
<tr><td><code>ForwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal.</td><td><code>arg&lt;1&gt;</code> </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 fold_backward&lt; Sequence,T,BackwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;BackwardOp&gt;::type bk_op; typedef begin&lt;Sequence&gt;::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply&lt;bk_op,T,in::type&gt;::type tn; typedef apply&lt;bk_op,tn,in-1::type&gt;::type tn-1; ...; typedef apply&lt;bk_op,t2,i1::type&gt;::type t1; typedef t1 t</code>, where <code>n == size&lt;Sequence&gt;::type::value</code> and <code>last</code> is identical to <code>end&lt;Sequence&gt;::type</code>; Equivalent to <code>typedef T t;</code> if the sequence is empty.</td><td></td></tr>
<tr><td><code>typedef fold_backward&lt; Sequence,T,BackwardOp,ForwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold_backward&lt;Sequence, fold&lt;Sequence,State,ForwardOp&gt;::type, BackwardOp&gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BackwardOp</code> and <code>ForwardOp</code>.
<p>
<h3>Example</h3>
<p>
Removes negative elements from a sequence [<a href="#1">1</a>].
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,5,-1,0,-7,-2,0,-5,4&gt; numbers;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,-1,-7,-2,-5&gt; negatives;
typedef fold_backward&lt;
numbers
, <a href="../Reference/list_c.html">list_c</a>&lt;int&gt;
, if_&lt; <a href="../Reference/less.html">less</a>&lt; _2,int_c&lt;0&gt; &gt;, push_front&lt;_1,_2,&gt;, _1 &gt;
&gt;::type result;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>&lt; negatives,result,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] See <code><a href="../Reference/remove_if.html">remove_if</a></code> for a more compact way to do this.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/iter_fold_backward.html">iter_fold_backward</a></code>, <code><a href="../Reference/iter_fold.html">iter_fold</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 1:58 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/front</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>front</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct front
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a type identical to the first element in the sequence.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/front.hpp">boost/mpl/front.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 examined. </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 front&lt;Sequence&gt;::type t;</code></td><td>A type</td><td><code>empty&lt;Sequence&gt;::type::value == false</code></td><td>Equivalent to <code>typedef begin&lt;Sequence&gt;::type::type t;</code></td><td></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;long&gt;::type types1;
typedef list&lt;int,long&gt;::type types2;
typedef list&lt;char,int,long&gt;::type types3;
<p>
BOOST_MPL_ASSERT_IS_SAME(front&lt;types1&gt;::type, long);
BOOST_MPL_ASSERT_IS_SAME(front&lt;types2&gt;::type, int);
BOOST_MPL_ASSERT_IS_SAME(front&lt;types3&gt;::type, char);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Forward_Sequence.html">Forward Sequence</a>, <code><a href="../Reference/back.html">back</a></code>, <code><a href="../Reference/at.html">at</a></code>, <code><a href="../Reference/push_front.html">push_front</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/empty.html">empty</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:48 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/greater</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>greater</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct greater
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value &gt; T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/greater.hpp">boost/mpl/comparison/greater.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 greater&lt;t1,t2&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_c&lt;(t1::value &gt; t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,2,3,5,7,12,19,31&gt; fibonacci;
typedef <a href="../Reference/find_if.html">find_if</a>&lt; fibonacci, greater&lt;_,int_c&lt;10&gt; &gt; &gt;::type iter;
BOOST_STATIC_ASSERT(iter::type::value == 12));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>greater</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/greater_equal.html">greater_equal</a></code>, <code><a href="../Reference/less.html">less</a></code>, <code><a href="../Reference/less_equal.html">less_equal</a></code>, <code><a href="../Reference/equal_to.html">equal_to</a></code>, <code><a href="../Reference/not_equal_to.html">not_equal_to</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:16 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/greater equal</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>greater_equal</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct greater_equal
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value &gt; T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/greater_equal.hpp">boost/mpl/comparison/greater_equal.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 greater_equal&lt;t1,t2&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_c&lt;(t1::value &gt;= t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt; numbers;
typedef <a href="../Reference/remove_if.html">remove_if</a>&lt; numbers, greater_equal&lt;_,int_c&lt;5&gt; &gt; &gt;::type result;
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>&lt; result,<a href="../Reference/range_c.html">range_c</a>&lt;int,0,5&gt;,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>greater_equal</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/greater.html">greater</a></code>, <code><a href="../Reference/less.html">less</a></code>, <code><a href="../Reference/less_equal.html">less_equal</a></code>, <code><a href="../Reference/equal_to.html">equal_to</a></code>, <code><a href="../Reference/not_equal_to.html">not_equal_to</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:16 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/insert</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>insert</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pos
, typename T
&gt;
struct insert
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>insert</code> performs an insertion of type <code>T</code> at an arbitrary position in the sequence. The algorithm returns a new sequence which contains all the elements from <code>Sequence</code> plus the type <code>T</code> at the <code>distance&lt; begin&lt;Sequence&gt;::type,Pos &gt;::type</code> position from the beginning. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/insert.hpp">boost/mpl/insert.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the insert operation. </td></tr>
<tr><td><code>Pos</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td>An insert position in the <code>Sequence</code>. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The element to be inserted. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef insert&lt;Sequence,pos,T&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>pos</code> is a valid iterator in <code>Sequence</code>.</td><td><code>s</code> contains <code>T</code> at the <code>distance&lt; begin&lt;Sequence&gt;::type,pos &gt;::type</code> position.</td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value + 1</code>; <code>at&lt; distance&lt; begin&lt;Sequence&gt;::type,pos &gt;::type, s &gt;::type</code> is identical to <code>T</code>; the relative order of the elements in <code>s</code> is the same as in <code>Sequence</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Sequence dependent. Linear in the worst case, or amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,3,4,5,6,7,8,9&gt; numbers;
typedef <a href="../Reference/find.html">find</a>&lt; numbers,integral_c&lt;int,3&gt; &gt;::type pos;
typedef insert&lt; numbers,pos,integral_c&lt;int,2&gt; &gt;::type range;
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;range&gt;::type::value == 10);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; range,<a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt; &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/insert_range.html">insert_range</a></code>, <code><a href="../Reference/push_front.html">push_front</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>, <code><a href="../Reference/erase.html">erase</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 5:17 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/insert range</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>insert_range</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pos
, typename Range
&gt;
struct insert_range
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>insert_range</code> performs an insertion of a range of elements at an arbitrary position in the sequence. The algorithm returns a new sequence which contains all the elements of <code>Sequence</code> plus all the elements of <code>Range</code> starting at the <code>distance&lt; begin&lt;Sequence&gt;::type,Pos &gt;::type</code> position from the beginning. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/insert_range.hpp">boost/mpl/insert_range.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the insert operation. </td></tr>
<tr><td><code>Pos</code></td><td>A model of <a href="../Forward_Iterator.html">Forward Iterator</a></td><td>An insert position in the <code>Sequence</code>. </td></tr>
<tr><td><code>Range</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>The range of elements to be inserted. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition &nbsp;</th></tr>
<tr><td><code>typedef insert&lt;Sequence,pos,range&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>pos</code> is a valid iterator in <code>Sequence</code>.</td><td><code>s</code> contains all the elements from <code>range</code> starting at the <code>distance&lt; begin&lt;Sequence&gt;::type,pos &gt;::type</code> position.</td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value + size&lt;range&gt;::type::value</code>; the relative order of the elements in <code>s</code> is the same as in <code>Sequence</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,7,8,9&gt; numbers;
typedef <a href="../Reference/find.html">find</a>&lt; numbers,integral_c&lt;int,7&gt; &gt;::type pos;
typedef insert_range&lt; numbers,pos,<a href="../Reference/range_c.html">range_c</a>&lt;int,2,7&gt; &gt;::type range;
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;range&gt;::type::value == 10);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; range,<a href="../Reference/range_c.html">range_c</a>&lt;int,0,10&gt; &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/insert.html">insert</a></code>, <code><a href="../Reference/push_front.html">push_front</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>, <code><a href="../Reference/erase.html">erase</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 22, 2002 4:32 pm</body></html>
+65
View File
@@ -0,0 +1,65 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/iter fold</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>iter_fold</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename ForwardOp
&gt;
struct iter_fold
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of binary <code>ForwardOp</code> to the result of the previous <code>ForwardOp</code> invocation (<code>State</code> if it's the first call) and each iterator in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> in the linear order.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/iter_fold.hpp">boost/mpl/iter_fold.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="../Sequence.html">Sequence</a></td><td>A sequence to iterate. </td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>ForwardOp</code> application. </td></tr>
<tr><td><code>ForwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal. </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 iter_fold&lt;Sequence,T,Op&gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;Op&gt;::type op; typedef begin&lt;Sequence&gt;::type i1; typedef apply&lt;op,T,i1&gt;::type t1; typedef i1::next i2; typedef apply&lt;op,t1,i2&gt;::type t2; ...; typedef apply&lt;op,T,in&gt;::type tn; typedef in::next last; typedef tn t</code>, where <code>n == size&lt;Sequence&gt;::type::value</code> and <code>last</code> is identical to <code>end&lt;Sequence&gt;::type</code>; Equivalent to <code>typedef T t;</code> if the sequence is empty.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>ForwardOp</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,5,-1,0,7,2,0,-5,4&gt; numbers;
typedef iter_fold&lt;
numbers
, <a href="../Reference/begin.html">begin</a>&lt;numbers&gt;::type
, if_&lt; <a href="../Reference/less.html">less</a>&lt; deref&lt;_1&gt;, deref&lt;_2&gt; &gt;,_2,_1 &gt;
&gt;::type max_element_iter;
<p>
BOOST_STATIC_ASSERT(max_element_iter::type::value == 7);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/iter_fold_backward.html">iter_fold_backward</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 1:16 am</body></html>
+71
View File
@@ -0,0 +1,71 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/iter fold backward</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>iter_fold_backward</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BackwardOp
, typename ForwardOp = _1
&gt;
struct iter_fold_backward
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of binary <code>BackwardOp</code> to the result of the previous <code>BackwardOp</code> invocation (<code>State</code> if it's the first call) and each iterator in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> in the reverse order. If <code>ForwardOp</code> is provided, then it's applied on forward traversal to form the result which is passed to the first <code>BackwardOp</code> call.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/iter_fold_backward.hpp">boost/mpl/iter_fold_backward.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><th>&nbsp;Default value &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>A sequence to iterate.</td><td></td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BackwardOp</code>/<code>ForwardOp</code> application.</td><td></td></tr>
<tr><td><code>BackwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on backward traversal.</td><td></td></tr>
<tr><td><code>ForwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal.</td><td><code>arg&lt;1&gt;</code> </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 iter_fold_backward&lt; Sequence,T,BackwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;BackwardOp&gt;::type bk_op; typedef begin&lt;Sequence&gt;::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply&lt;bk_op,T,in&gt;::type tn; typedef apply&lt;bk_op,tn,in-1&gt;::type tn-1; ...; typedef apply&lt;bk_op,t2,i1&gt;::type t1; typedef t1 t</code>, where <code>n == size&lt;Sequence&gt;::type::value</code> and <code>last</code> is identical to <code>end&lt;Sequence&gt;::type</code>; Equivalent to <code>typedef T t;</code> if the sequence is empty.</td><td></td></tr>
<tr><td><code>typedef iter_fold_backward&lt; Sequence,T,BackwardOp,ForwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef iter_fold_backward&lt;Sequence, iter_fold&lt;Sequence,State,ForwardOp&gt;::type, BackwardOp&gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BackwardOp</code> and <code>ForwardOp</code>.
<p>
<h3>Example</h3>
<p>
Builds a list of iterators to the negative elements in a sequence.
<p>
<pre>
typedef <a href="../Reference/vector_c.html">vector_c</a>&lt;int,5,-1,0,-7,-2,0,-5,4&gt; numbers;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,-1,-7,-2,-5&gt; negatives;
typedef iter_fold_backward&lt;
numbers
, <a href="../Reference/list.html">list</a>&lt;&gt;
, if_&lt; <a href="../Reference/less.html">less</a>&lt; deref&lt;_2&gt;,int_c&lt;0&gt; &gt;, push_front&lt;_1,_2&gt;, _1 &gt;
&gt;::type iters;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>&lt; negatives, <a href="../Reference/transform_view.html">transform_view</a>&lt; iters,deref&lt;_&gt; &gt;, <a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/iter_fold.html">iter_fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 1:58 am</body></html>
+70
View File
@@ -0,0 +1,70 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/iter fold if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>iter_fold_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename State
, typename BackwardOp
, typename ForwardOp = _1
&gt;
struct iter_fold_backward
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the result of the successive application of binary <code>BackwardOp</code> to the result of the previous <code>BackwardOp</code> invocation (<code>State</code> if it's the first call) and each iterator in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> in the reverse order. If <code>ForwardOp</code> is provided, then it's applied on forward traversal to form the result which is passed to the first <code>BackwardOp</code> call.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/iter_fold_backward.hpp">boost/mpl/iter_fold_backward.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><th>&nbsp;Default value &nbsp;</th></tr>
<tr><td><code>Sequence</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>A sequence to iterate.</td><td></td></tr>
<tr><td><code>State</code></td><td>A type</td><td>The initial state for the first <code>BackwardOp</code>/<code>ForwardOp</code> application.</td><td></td></tr>
<tr><td><code>BackwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on backward traversal.</td><td></td></tr>
<tr><td><code>ForwardOp</code></td><td>A model of [Lambda Function]</td><td>The operation to be executed on forward traversal.</td><td><code>arg&lt;1&gt;</code> </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 iter_fold_backward&lt; Sequence,T,BackwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda&lt;BackwardOp&gt;::type bk_op; typedef begin&lt;Sequence&gt;::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply&lt;bk_op,T,in&gt;::type tn; typedef apply&lt;bk_op,tn,in-1&gt;::type tn-1; ...; typedef apply&lt;bk_op,t2,i1&gt;::type t1; typedef t1 t</code>, where <code>n == size&lt;Sequence&gt;::type::value</code> and <code>last</code> is identical to <code>end&lt;Sequence&gt;::type</code>; Equivalent to <code>typedef T t;</code> if the sequence is empty.</td><td></td></tr>
<tr><td><code>typedef iter_fold_backward&lt; Sequence,T,BackwardOp,ForwardOp &gt;::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef iter_fold_backward&lt;Sequence, iter_fold&lt;Sequence,State,ForwardOp&gt;::type, BackwardOp&gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>BackwardOp</code> and <code>ForwardOp</code>.
<p>
<h3>Example</h3>
<p>
Finds an iterator to the last negative element in the sequence.
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,5,-1,0,7,2,0,-5,4&gt; numbers;
typedef iter_fold_backward&lt;
numbers
, <a href="../Reference/end.html">end</a>&lt;numbers&gt;::type
, if_&lt; <a href="../Reference/less.html">less</a>&lt; deref&lt;_2&gt;, int_c&lt;0&gt; &gt;,_2,_1 &gt;
&gt;::type last_negative_iter;
<p>
BOOST_STATIC_ASSERT(last_negative_iter::type::value == -5);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/iter_fold.html">iter_fold</a></code>, <code><a href="../Reference/fold_backward.html">fold_backward</a></code>, <code><a href="../Reference/fold.html">fold</a></code>, <code><a href="../Reference/copy.html">copy</a></code>, <code><a href="../Reference/copy_backward.html">copy_backward</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 19, 2002 1:25 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/iterator category</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>iterator_category</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Iterator
&gt;
struct iterator_category
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns one of the following iterator category tags: <code>input_iterator_tag</code>, <code>forward_iterator_tag</code>, <code>bidirectional_iterator_tag</code>, or <code>random_access_iterator_tag</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/iterator_category.hpp">boost/mpl/iterator_category.hpp</a>"
#include "<a href="../../../../../\boost/mpl/iterator_tag.hpp">boost/mpl/iterator_tag.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="../Input_Iterator.html">Input Iterator</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 iterator_category&lt;Iterator&gt;::type tag;</code></td><td>An iterator category tag</td><td></td><td><code>tag</code> is <code>input_iterator_tag</code> if <code>Iterator</code> is a model of <a href="../Input_Iterator.html">Input Iterator</a>, <code>forward_iterator_tag</code> if <code>Iterator</code> is a model of <a href="../Forward_Iterator.html">Forward Iterator</a>, <code>bidirectional_iterator_tag</code> if <code>Iterator</code> is a model of <a href="../Bidirectional_Iterator.html">Bidirectional Iterator</a>, or <code>random_access_iterator_tag</code> if <code>Iterator</code> is a model of <a href="../Random_Access_Iterator.html">Random Access Iterator</a>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
template&lt; typename Iterator &gt;
struct my_algorithm
: my_algorithm_impl&lt;
iterator_category&lt;Iterator&gt;::type
, Iterator
&gt;
{
};
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Iterators.html">Iterators</a>, <a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>, <code><a href="../Reference/advance.html">advance</a></code>, <code><a href="../Reference/distance.html">distance</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 6:20 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/less</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>less</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct less
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value &lt; T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/less.hpp">boost/mpl/comparison/less.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 less&lt;t1,t2&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_c&lt;(t1::value &lt; t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt; numbers;
typedef <a href="../Reference/remove_if.html">remove_if</a>&lt; numbers, less&lt;_,int_c&lt;5&gt; &gt; &gt;::type result;
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>&lt; result,<a href="../Reference/range_c.html">range_c</a>&lt;int,5,10&gt;,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>less</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/less_equal.html">less_equal</a></code>, <code><a href="../Reference/greater.html">greater</a></code>, <code><a href="../Reference/greater_equal.html">greater_equal</a></code>, <code><a href="../Reference/equal.html">equal</a></code>, <code><a href="../Reference/not_equal_to.html">not_equal_to</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:15 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/less equal</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>less_equal</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct less_equal
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value &lt;= T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/less_equal.hpp">boost/mpl/comparison/less_equal.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 less_equal&lt;t1,t2&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_c&lt;(t1::value &lt;= t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,0,1,2,3,4,5,6,7,8,9&gt; numbers;
typedef <a href="../Reference/remove_if.html">remove_if</a>&lt; numbers, less_equal&lt;_,int_c&lt;4&gt; &gt; &gt;::type result;
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>&lt; result,<a href="../Reference/range_c.html">range_c</a>&lt;int,5,10&gt;,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>less_equal</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/less.html">less</a></code>, <code><a href="../Reference/greater.html">greater</a></code>, <code><a href="../Reference/greater_equal.html">greater_equal</a></code>, <code><a href="../Reference/equal.html">equal</a></code>, <code><a href="../Reference/not_equal_to.html">not_equal_to</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:15 am</body></html>
+45
View File
@@ -0,0 +1,45 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/list</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>list</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1 = <em>implementation-defined</em>
, typename T2 = <em>implementation-defined</em>
, ...
, typename Tn = <em>implementation-defined</em>
&gt;
struct list
{
};
</pre>
<p>
<h3>Description</h3>
<p>
A <code>list</code> is a <a href="../Forward_Sequence.html">Forward Sequence</a> of types. It's also an <a href="../Extensible_Sequence.html">Extensible Sequence</a> that supports constant time insertion and removal of elements at the beginning (through <code><a href="../Reference/push_front.html">push_front</a></code>), and linear time insertion and removal of elements at the end or in the middle (through <code><a href="../Reference/insert.html">insert</a></code>/<code><a href="../Reference/erase.html">erase</a></code> algorithms).
<p>
<h3>Example</h3>
<p>
<pre>
typedef list&lt;float,double,long double&gt; floats;
typedef <a href="../Reference/push_front.html">push_front</a>&lt;floating_types,my_float&gt;::type ext_floats;
BOOST_STATIC_ASSERT((boost::is_same&lt; <a href="../Reference/front.html">front</a>&lt;ext_floats&gt;::type, my_float &gt;::value));
</pre>
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/list.hpp">boost/mpl/list.hpp</a>"
#include "<a href="../../../../../\boost/mpl/list/list0.hpp">boost/mpl/list/list0.hpp</a>"
#include "<a href="../../../../../\boost/mpl/list/list10.hpp">boost/mpl/list/list10.hpp</a>"
...
#include "<a href="../../../../../\boost/mpl/list/list50.hpp">boost/mpl/list/list50.hpp</a>"
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Forward_Sequence.html">Forward Sequence</a>, <code><a href="../Reference/list_c.html">list_c</a></code>, <code><a href="../Reference/vector.html">vector</a></code>, <code><a href="../Reference/vector_c.html">vector_c</a></code>, <code><a href="../Reference/range_c.html">range_c</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:05 am</body></html>
+58
View File
@@ -0,0 +1,58 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/list c</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>list_c</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T
, T C1 = <em>implementation-defined</em>
, T C2 = <em>implementation-defined</em>
, ...
, T CN = <em>implementation-defined</em>
&gt;
struct list_c
{
};
</pre>
<p>
<h3>Description</h3>
<p>
Similary to <code><a href="../Reference/vector_c.html">vector_c</a></code>, <code>list_c</code> is a shorcut interface whose whole purpose is to make the creation of a <code>list</code> of <a href="../Integral_Constant.html">Integral Constant</a>s less verbose:
<p>
<pre>
typedef list_c&lt;unsigned long,-1,0,1,1,-1,0,0,1,-1&gt; data;
</pre>
<p>
If <code>list_c</code> didn't exist, instead of the above line you would have to write this:
<p>
<pre>
typedef list&lt;
integral_c&lt;unsigned long,-1&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,-1&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,-1&gt;
&gt; data;
</pre>
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/list_c.hpp">boost/mpl/list_c.hpp</a>"
#include "<a href="../../../../../\boost/mpl/list/list0_c.hpp">boost/mpl/list/list0_c.hpp</a>"
#include "<a href="../../../../../\boost/mpl/list/list10_c.hpp">boost/mpl/list/list10_c.hpp</a>"
...
#include "<a href="../../../../../\boost/mpl/list/list50_c.hpp">boost/mpl/list/list50_c.hpp</a>"
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Random_Access_Sequence.html">Random Access Sequence</a>, <code><a href="../Reference/list.html">list</a></code>, <code><a href="../Reference/vector.html">vector</a></code>, <code><a href="../Reference/vector_c.html">vector_c</a></code>, <code><a href="../Reference/range_c.html">range_c</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:04 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/logical and</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>logical_and</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F1
, typename F2
, typename F3 = true_c
...
, typename Fn = true_c
&gt;
struct logical_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/logical/and.hpp">boost/mpl/logical/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;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef logical_and&lt;f1,f2,..,fn&gt;::type c;</code></td><td></td><td>Returns <code>false_c</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to <code>false</code>, and <code>true_c</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((logical_and&lt; true_c,false_c &gt;::type::value == false));
BOOST_STATIC_ASSERT((logical_and&lt; false_c,fail&lt;int&gt; &gt;::type::value == false)); <span class="cxx-comment">// ok, fail&lt;int&gt; is never invoked</span>
BOOST_STATIC_ASSERT((logical_and&lt; true_c,false_c,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/logical_or.html">logical_or</a></code>, <code><a href="../Reference/logical_not.html">logical_not</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 1:06 am</body></html>
+51
View File
@@ -0,0 +1,51 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/logical not</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>logical_not</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F
&gt;
struct logical_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/logical/not.hpp">boost/mpl/logical/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 logical_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_c&lt;(!f::type::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Example</h3>
<p>
<pre>
BOOST_STATIC_ASSERT(logical_not&lt;true_c&gt;::type::value == false);
BOOST_STATIC_ASSERT(logical_not&lt;false_c&gt;::type::value == true);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/logical_and.html">logical_and</a></code>, <code><a href="../Reference/logical_or.html">logical_or</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:13 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/logical or</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>logical_or</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename F1
, typename F2
, typename F3 = false_c
...
, typename Fn = false_c
&gt;
struct logical_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/logical/or.hpp">boost/mpl/logical/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 logical_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_c</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to true, and <code>false_c</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((logical_or&lt; false_c,true_c &gt;::type::value == true));
BOOST_STATIC_ASSERT((logical_or&lt; true_c,fail&lt;int&gt; &gt;::type::value == true)); <span class="cxx-comment">// ok, fail&lt;int&gt; is never invoked</span>
BOOST_STATIC_ASSERT((logical_or&lt; false_c,true_c,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/logical_and.html">logical_and</a></code>, <code><a href="../Reference/logical_not.html">logical_not</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:12 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/lower bound</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>lower_bound</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
, typename Pred
&gt;
struct lower_bound
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the first position in the sorted <code>Sequence</code> where <code>T</code> could be inserted without violating the ordering.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/lower_bound.hpp">boost/mpl/lower_bound.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 sorted sequence. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>A type to search the position for. </td></tr>
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A sort 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 lower_bound&lt; Sequence,T,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 furthermost 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, i)</code>, <code>apply&lt; lambda&lt;Pred&gt;::type, j::type, T &gt;::type::value == true</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
The number of comparisons is logarithmic: at most <code>log(size&lt;Sequence&gt;::type::value) + 1</code>. If <code>Sequence</code> is a <a href="../Random_Access_Sequence.html">Random Access Sequence</a> then the number of steps through the range is also logarithmic; otherwise, the number of steps is proportional to <code>size&lt;Sequence&gt;::type::value</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,2,3,3,3,5,8&gt; numbers;
typedef lower_bound&lt; numbers, int_c&lt;3&gt;, <a href="../Reference/less.html">less</a>&lt;_,_&gt; &gt;::type iter;
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>&lt; <a href="../Reference/begin.html">begin</a>&lt;numbers&gt;::type,iter &gt;::type::value == 2));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/sort.html">sort</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 5:13 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/minus</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>minus</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
, typaname T3 = integral_c&lt;int,0&gt;
, ...
, typaname Tn = integral_c&lt;int,0&gt;
&gt;
struct minus
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the difference of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/minus.hpp">boost/mpl/arithmetic/minus.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>T1, T2, .., Tn</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 minus&lt;t1,t2,..,tn&gt;::type diff;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value - t2::value .. - tn::value), t1::value - t2::value .. - tn::value &gt; diff;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef minus&lt; integral_c&lt;short,-1&gt;, integral_c&lt;long,10&gt; &gt;::type diff;
BOOST_STATIC_ASSERT(diff::value == -11));
BOOST_MPL_ASSERT_IS_SAME(diff::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>minus</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/divides.html">divides</a></code>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:06 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/modulus</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>modulus</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct modulus
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the modulus of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/modulus.hpp">boost/mpl/arithmetic/modulus.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 modulus&lt;t1,t2&gt;::type mod;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td><code>t2::value != 0 </code></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value % t2::value), t1::value % t2::value&gt; mod;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef modulus&lt; integral_c&lt;short,10&gt;, integral_c&lt;long,3&gt; &gt;::type mod;
BOOST_STATIC_ASSERT(mod::value == 1));
BOOST_MPL_ASSERT_IS_SAME(mod::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>modulus</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/divides.html">divides</a></code>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:10 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/multiplies</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>multiplies</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
, typaname T3 = integral_c&lt;int,1&gt;
, ...
, typaname Tn = integral_c&lt;int,1&gt;
&gt;
struct multiplies
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the product of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/multiplies.hpp">boost/mpl/arithmetic/multiplies.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>T1, T2, .., Tn</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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 multiplies&lt;t1,t2,..,tn&gt;::type product;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value * t2::value .. * tn::value), t1::value * t2::value .. * tn::value &gt; product;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef multiplies&lt; integral_c&lt;short,-1&gt;, integral_c&lt;long,10&gt; &gt;::type product;
BOOST_STATIC_ASSERT(product::value == -10));
BOOST_MPL_ASSERT_IS_SAME(product::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>multiplies</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/divides.html">divides</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:07 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/negate</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>negate</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T
&gt;
struct negate
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the negative (additive inverse) of its argument [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/negate.hpp">boost/mpl/arithmetic/negate.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 model of <a href="../Integral_Constant.html">Integral Constant</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 negate&lt;t&gt;::type n;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef integral_c&lt;t::value_type, -t::value&gt; n;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef negate&lt; integral_c&lt;short,-10&gt; &gt;::type n;
BOOST_STATIC_ASSERT(n::value == 10));
BOOST_MPL_ASSERT_IS_SAME(n::value_type, short);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>negate</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/divides.html">divides</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:10 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/next</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>next</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename T
&gt;
struct next
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/next.hpp">boost/mpl/next.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/prior.html">prior</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 4:25 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/not equal to</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>not_equal_to</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
&gt;
struct not_equal_to
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_c</code> if <code>T1::value != T2::value</code> and <code>false_c</code> otherwise [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/comparison/not_equal_to.hpp">boost/mpl/comparison/not_equal_to.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>T1, T2</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</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_equal_to&lt;t1,t2&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_c&lt;(t1::value != t2::value)&gt; c;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,5,0,7,5,-1,2,4,5&gt; numbers;
typedef <a href="../Reference/remove_if.html">remove_if</a>&lt; numbers, not_equal_to&lt;_,int_c&lt;5&gt; &gt; &gt;::type fives;
BOOST_STATIC_ASSERT(<a href="../Reference/equal_to.html">equal_to</a>&lt; <a href="../Reference/count_if.html">count_if</a>&lt; fives, <a href="../Reference/equal_to.html">equal_to</a>&lt;_,int_c&lt;5&gt; &gt; &gt;::type, <a href="../Reference/size.html">size</a>&lt;fives&gt;::type &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>not_equal_to</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/equal_to.html">equal_to</a></code>, <code><a href="../Reference/less.html">less</a></code>, <code><a href="../Reference/less_equal.html">less_equal</a></code>, <code><a href="../Reference/greater.html">greater</a></code>, <code><a href="../Reference/greater_equal.html">greater_equal</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:14 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/plus</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>plus</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1
, typaname T2
, typaname T3 = integral_c&lt;int,0&gt;
, ...
, typaname Tn = integral_c&lt;int,0&gt;
&gt;
struct plus
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the sum of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/arithmetic/plus.hpp">boost/mpl/arithmetic/plus.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>T1, T2, .., Tn</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef plus&lt;t1,t2,..,tn&gt;::type sum;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value + t2::value .. + tn::value), t1::value + t2::value .. + tn::value &gt; sum;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef plus&lt; integral_c&lt;short,-1&gt;, integral_c&lt;long,10&gt; &gt;::type sum;
BOOST_STATIC_ASSERT(sum::value == 9));
BOOST_MPL_ASSERT_IS_SAME(sum::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>plus</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/divides.html">divides</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 4:05 am</body></html>
+71
View File
@@ -0,0 +1,71 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/pop back</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>pop_back</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct pop_back
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>pop_back</code> performs a removal at the end of the sequence. The algorithm returns a new sequence which contains all the elements in the range <code>[begin&lt;Sequence&gt;::type, prior&lt; end&lt;Sequence&gt;::type &gt;::type)</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/pop_back.hpp">boost/mpl/pop_back.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the erase operation </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 pop_back&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>empty&lt;Sequence&gt;::type::value == false</code></td><td>Equivalent to <code>typedef erase&lt; Sequence, prior&lt; end&lt;Sequence&gt;::type &gt;::type &gt;::type s;</code></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value - 1</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;long&gt;::type types1;
typedef list&lt;long,int&gt;::type types2;
typedef list&lt;long,int,char&gt;::type types3;
<p>
typedef pop_back&lt;types1&gt;::type result1;
typedef pop_back&lt;types2&gt;::type result2;
typedef pop_back&lt;types3&gt;::type result3;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(size&lt;result2&gt;::type::value == 1);
BOOST_STATIC_ASSERT(size&lt;result3&gt;::type::value == 2);
<p>
BOOST_MPL_ASSERT_IS_SAME(<a href="../Reference/back.html">back</a>&lt;result2&gt;::type, long);
BOOST_MPL_ASSERT_IS_SAME(back&lt;result3&gt;::type, int);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>, <code><a href="../Reference/back.html">back</a></code>, <code><a href="../Reference/pop_front.html">pop_front</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:56 am</body></html>
+71
View File
@@ -0,0 +1,71 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/pop front</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>pop_front</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct pop_front
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>pop_front</code> performs a removal at the beginning of the sequence. The algorithm returns a new sequence which contains all the elements in the range <code>[next&lt; begin&lt;Sequence&gt;::type &gt;::type, end&lt;Sequence&gt;::type)</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/pop_front.hpp">boost/mpl/pop_front.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the erase operation </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 pop_front&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>empty&lt;Sequence&gt;::type::value == false</code></td><td>Equivalent to <code>typedef erase&lt; Sequence, begin&lt;Sequence&gt;::type &gt;::type s;</code></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value - 1</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;long&gt;::type types1;
typedef <a href="../Reference/list.html">list</a>&lt;int,long&gt;::type types2;
typedef <a href="../Reference/list.html">list</a>&lt;char,int,long&gt;::type types3;
<p>
typedef pop_front&lt;types1&gt;::type result1;
typedef pop_front&lt;types2&gt;::type result2;
typedef pop_front&lt;types3&gt;::type result3;
<p>
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;result1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(size&lt;result2&gt;::type::value == 1);
BOOST_STATIC_ASSERT(size&lt;result3&gt;::type::value == 2);
<p>
BOOST_MPL_ASSERT_IS_SAME(<a href="../Reference/front.html">front</a>&lt;result2&gt;::type, long);
BOOST_MPL_ASSERT_IS_SAME(front&lt;result3&gt;::type, int);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code><a href="../Reference/push_front.html">push_front</a></code>, <code><a href="../Reference/front.html">front</a></code>, <code><a href="../Reference/pop_back.html">pop_back</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:54 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/prior</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>prior</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename T
&gt;
struct prior
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/prior.hpp">boost/mpl/prior.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/next.html">next</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 4:25 am</body></html>
+63
View File
@@ -0,0 +1,63 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/push back</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>push_back</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct push_back
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>push_back</code> performs an insertion at the end of the sequence. The algorithm returns a new sequence which contains type <code>T</code> as its last element. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/push_back.hpp">boost/mpl/push_back.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the insert operation. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The element to be inserted. </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 push_back&lt;Sequence,T&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td>Equivalent to <code>typedef insert&lt; Sequence,end&lt;Sequence&gt;::type,T &gt;::type s;</code></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value + 1</code>; <code>back&lt;s&gt;::type</code> is identical to <code>T</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector_c.html">vector_c</a>&lt;bool,false,false,false,true,true,true,false,false&gt; bools;
typedef push_back&lt;bools,false_c&gt;::type message;
BOOST_STATIC_ASSERT(<a href="../Reference/back.html">back</a>&lt;message&gt;::type::value == false);
BOOST_STATIC_ASSERT((<a href="../Reference/count_if.html">count_if</a>&lt;message, <a href="../Reference/equal_to.html">equal_to</a>&lt;_,false_c&gt; &gt;::type::value == 6));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is can be viewed as a notational shorcut to more verbose <code>insert&lt; Sequence,end&lt;Sequence&gt;::type,T &gt;::type</code>, and is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/insert.html">insert</a></code>, <code><a href="../Reference/back.html">back</a></code>, <code><a href="../Reference/pop_back.html">pop_back</a></code>, <code><a href="../Reference/push_front.html">push_front</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:57 am</body></html>
+64
View File
@@ -0,0 +1,64 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/push front</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>push_front</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct push_front
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>push_front</code> performs an insertion at the beginning of the sequence. The algorithm returns a new sequence which contains type <code>T</code> as its first element. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/push_front.hpp">boost/mpl/push_front.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>A sequence to handle the insert operation. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>The element to be inserted. </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 push_front&lt;Sequence,T&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef insert&lt; Sequence,begin&lt;Sequence&gt;::type,T &gt;::type s;</code></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value + 1</code>; <code>front&lt;s&gt;::type</code> is identical to <code>T</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,2,3,5,8,13,21&gt; something;
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a>&lt;something&gt;::type::value == 7);
typedef <a href="../Reference/push_front.html">push_front</a>&lt; something,integral_c&lt;int,1&gt; &gt;::type fibonacci;
BOOST_STATIC_ASSERT(size&lt;fibonacci&gt;::type::value == 8);
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; fibonacci,list_c&lt;int,1,1,2,3,5,8,13,21&gt;,equal_to&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The algorithm is can be viewed as a notational shorcut to more verbose <code>insert&lt; Sequence,begin&lt;Sequence&gt;::type,T &gt;::type</code>, and is provided only if the sequence can meet the stated complexity requirements.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Extensible_Sequence.html">Extensible Sequence</a>, <code><a href="../Reference/insert.html">insert</a></code>, <code><a href="../Reference/front.html">front</a></code>, <code><a href="../Reference/pop_front.html">pop_front</a></code>, <code><a href="../Reference/push_back.html">push_back</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:53 am</body></html>
+71
View File
@@ -0,0 +1,71 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/range c</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>range_c</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T
, T Start
, T Finish
&gt;
struct range_c
{
typedef integral_c&lt;T,Start&gt; start;
typedef integral_c&lt;T,Finish&gt; finish;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>range_c</code> is a sorted <a href="../Random_Access_Sequence.html">Random Access Sequence</a> of <a href="../Integral_Constant.html">Integral Constant</a>s. It is <em>not</em> an <a href="../Extensible_Sequence.html">Extensible Sequence</a>, meaning that transformation algorithms, such as <code><a href="../Reference/push_front.html">push_front</a></code> or <code><a href="../Reference/replace.html">replace</a></code>, are not applicable to it, at least directly - you need to copy the content of the range into a more suitable sequence, when needed [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/range_c.hpp">boost/mpl/range_c.hpp</a>"
</pre>
<p>
<h3>Example</h3>
<p>
<pre>
typedef range_c&lt;int,0,0&gt; range0;
typedef range_c&lt;int,0,1&gt; range1;
typedef range_c&lt;int,0,10&gt; range10;
<p>
BOOST_STATIC_ASSERT(size&lt;range0&gt;::type::value == 0);
BOOST_STATIC_ASSERT(size&lt;range1&gt;::type::value == 1);
BOOST_STATIC_ASSERT(size&lt;range10&gt;::type::value == 10);
<p>
BOOST_STATIC_ASSERT(empty&lt;range0&gt;::type::value);
BOOST_STATIC_ASSERT(!empty&lt;range1&gt;::type::value);
BOOST_STATIC_ASSERT(!empty&lt;range10&gt;::type::value);
<p>
BOOST_MPL_ASSERT_IS_SAME(begin&lt;range0&gt;::type, end&lt;range0&gt;::type);
BOOST_MPL_ASSERT_NOT_SAME(begin&lt;range1&gt;::type, end&lt;range1&gt;::type);
BOOST_MPL_ASSERT_NOT_SAME(begin&lt;range10&gt;::type, end&lt;range10&gt;::type);
<p>
BOOST_STATIC_ASSERT(front&lt;range1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(back&lt;range1&gt;::type::value == 0);
BOOST_STATIC_ASSERT(front&lt;range10&gt;::type::value == 0);
BOOST_STATIC_ASSERT(back&lt;range10&gt;::type::value == 9);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] In fact, the most common application of <code>range_c</code> class is to simplify the creation of sorted <code>list</code> or <code>vector</code>:
<p>
<pre>
typedef copy&lt;
range_c&lt;int,0,50&gt;
, <a href="../Reference/push_back.html">push_back</a>&lt;_,_&gt;
, vector&lt;&gt;
&gt;::type numbers;
</pre><br>
<p>
<h3>See also</h3>
<p>
<a href="../Random_Access_Sequence.html">Random Access Sequence</a>, <code><a href="../Reference/vector.html">vector</a></code>, <code><a href="../Reference/vector_c.html">vector_c</a></code>, <code><a href="../Reference/list.html">list</a></code>, <code><a href="../Reference/list_c.html">list_c</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:31 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/remove</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>remove</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
&gt;
struct remove
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a new sequence which contains all the elements from <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> range except those that are identical to <code>T</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/remove.hpp">boost/mpl/remove.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>A type to be removed. </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 remove&lt;Sequence,T&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef remove_if&lt; Sequence,is_same&lt;_,T&gt; &gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Performs exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> comparisons for equality.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,float,char,float,float,double&gt;::type types;
typedef remove&lt; types,float &gt;::type result;
typedef <a href="../Reference/list.html">list</a>&lt;int,char,double&gt;::type answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; result,answer &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/remove_if.html">remove_if</a></code>, <code><a href="../Reference/replace.html">replace</a></code>, <code><a href="../Reference/replace_if.html">replace_if</a></code>, <code><a href="../Reference/transform.html">transform</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:43 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/remove if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>remove_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred
&gt;
struct remove_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns a new sequence which contains all the elements from <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> range except those that satisfy the predicate <code>Pred</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, except its size and identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/remove_if.hpp">boost/mpl/remove_if.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>Pred</code></td><td>An unary Predicate [Lambda Expression]</td><td>A removal condition. </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 remove_if&lt;Sequence,Pred&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Performs exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>Pred</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,4,5,2,7,5,3,5&gt;::type numbers;
typedef remove_if&lt; numbers, greater&lt;_,4&gt; &gt;::type result;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,4,2,3&gt;::type answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; answer,result,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/remove.html">remove</a></code>, <code><a href="../Reference/replace.html">replace</a></code>, <code><a href="../Reference/transform.html">transform</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:43 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/replace</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>replace</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename OldType
, typename NewType
&gt;
struct replace
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Performs a replacement operation on the sequence. The algorithm returns a new sequence which contains all the elements from <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> range where every type identical to <code>OldType</code> has been replaced with a <code>NewType</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, including its size, but not identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/replace.hpp">boost/mpl/replace.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>OldType</code></td><td>A type</td><td>A type to be replaced. </td></tr>
<tr><td><code>NewType</code></td><td>A type</td><td>A type to replace with. </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 replace&lt;Sequence,OldType,NewType&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef replace_if&lt; Sequence,NewType,is_same&lt;_,OldType&gt; &gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Performs exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> comparisons for equality, and at most <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> insertions.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,float,char,float,float,double&gt;::type types;
typedef replace&lt; types,float,double &gt;::type result;
typedef <a href="../Reference/list.html">list</a>&lt;int,double,char,double,double,double&gt;::type answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; result,answer &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/replace_if.html">replace_if</a></code>, <code><a href="../Reference/transform.html">transform</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 5:38 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/replace if</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>replace_if</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Pred
, typename NewType
&gt;
struct replace_if
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Performs a conditional replacement operation on the sequence. The algorithm returns a new sequence which contains all the elements from <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> range where every type that satisfies the predicate <code>Pred</code> has been replaced with a <code>NewType</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, including its size, but not identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/replace_if.hpp">boost/mpl/replace_if.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>Pred</code></td><td>An unary Predicate [Lambda Expression]</td><td>The replacement condition. </td></tr>
<tr><td><code>NewType</code></td><td>A type</td><td>A type to replace with. </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 replace_if&lt;Sequence,Pred,NewType&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef lambda&lt;Pred&gt;::type pred; typedef transform&lt; Sequence, if_&lt; apply1&lt;pred,_1&gt;,NewType,_1&gt; &gt;::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Performs exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> insertions.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,4,5,2,7,5,3,5&gt;::type numbers;
typedef replace_if&lt; numbers, greater&lt;_,4&gt;, int_c&lt;0&gt; &gt;::type result;
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,4,0,2,0,0,3,0&gt;::type answer;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt; answer,result,<a href="../Reference/equal_to.html">equal_to</a>&lt;_,_&gt; &gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/replace.html">replace</a></code>, <code><a href="../Reference/transform.html">transform</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 5:38 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/reverse</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>reverse</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct reverse
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/reverse.hpp">boost/mpl/reverse.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/fold.html">fold</a></code>, <code>fold_reverse</code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 4:11 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/size</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>size</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
&gt;
struct size
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>size</code> returns the number of elements in the sequence, that is, the number of elements in the range <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/size.hpp">boost/mpl/size.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="../Sequence.html">Sequence</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 size&lt;Sequence&gt;::type s;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>typedef distance&lt; begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type &gt;::type s;</code></td><td><code>s::value &gt;= 0</code> </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
The complexity of the <code>size</code> algorithm directly depends on the implementation of the particular sequence it is applied to. In the worst case <code>size</code> has a linear complexity. As a general rule, if the <code>Sequence</code> is a <a href="../Random_Access_Sequence.html">Random Access Sequence</a>, you can be certain that <code>size&lt;Sequence&gt;::type</code> is an amortized constant time operation. The opposite is not necessary true - for example, a model of <a href="../Forward_Sequence.html">Forward Sequence</a> still can guarantee you an amortized constant time <code>size</code> complexity. Please refer the documentation page of the concrete sequence type for further information.
<p>
<h3>Example</h3>
<p>
<pre>
typedef list0&lt;&gt; empty_list;
typedef vector_c&lt;int,0,1,2,3,4,5&gt; numbers;
typedef range_c&lt;int,0,100&gt; more_numbers;
<p>
BOOST_STATIC_ASSERT(size&lt;list&gt;::type::value == 0);
BOOST_STATIC_ASSERT(size&lt;numbers&gt;::type::value == 5);
BOOST_STATIC_ASSERT(size&lt;more_numbers&gt;::type::value == 100);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequence.html">Sequence</a>, <code><a href="../Reference/empty.html">empty</a></code>, <code><a href="../Reference/begin.html">begin</a></code>, <code><a href="../Reference/end.html">end</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 3:51 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/sort</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>sort</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Compare = less&lt;_1,_2&gt;
&gt;
struct sort
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/sort.hpp">boost/mpl/sort.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 4:22 am</body></html>
+59
View File
@@ -0,0 +1,59 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/transform</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>transform</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Op
&gt;
struct transform
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Performs a transformation on the sequence. The algorithm returns a new sequence produced by applying the unary metafunction <code>Op</code> to every element in the <code>[begin&lt;Sequence&gt;::type, end&lt;Sequence&gt;::type)</code> range. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, including its size, but not identity.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/transform.hpp">boost/mpl/transform.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="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>Op</code></td><td>An unary [Lambda Expression]</td><td>A transformation. </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 transform&lt;Sequence,Op&gt;::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td></td><td><code>size&lt;s&gt;::type::value == size&lt;Sequence&gt;::type::value</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. The operation <code>Op</code> is applied exactly <code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value</code> times.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;char,short,int,long,float,double&gt; types;
typedef <a href="../Reference/list.html">list</a>&lt;char*,short*,int*,long*,float*,double*&gt; pointers;
typedef transform&lt; types,boost::add_pointer&lt;_1&gt; &gt;::type result;
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>&lt;result,pointers&gt;::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/replace.html">replace</a></code>, <code><a href="../Reference/replace_if.html">replace_if</a></code>, <code><a href="../Reference/transform.html">transform</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 5:47 am</body></html>
+61
View File
@@ -0,0 +1,61 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/transform view</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>transform_view</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename F
&gt;
struct transform_view
{
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>transform_view</code> is a sequence wrapper that allows one to operate on the transformed sequence without actually creating one.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/transform_view.hpp">boost/mpl/transform_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>Sequence</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>A sequence to wrap. </td></tr>
<tr><td><code>F</code></td><td>A model of unary [Lambda Expression]</td><td>A transformation metafunction. </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 transform_view&lt;Sequence,F&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;Sequence&gt;::type, <a href="../Reference/end.html">end</a>&lt;Sequence&gt;::type)</code> <code>i::type</code> is identical to <code>apply&lt; lambda&lt;F&gt;::type, j::type &gt;::type</code>.</td><td><code><a href="../Reference/size.html">size</a>&lt;Sequence&gt;::type::value == <a href="../Reference/size.html">size</a>&lt;s&gt;::type::value</code>. </td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
Finds the largest type in a sequence.
<p>
<pre>
typedef <a href="../Reference/list.html">list</a>&lt;int,long,char,char[50],double&gt; types;
typedef max_element&lt;
transform_view&lt; types, size_of&lt;_&gt; &gt;
&gt;::type iter;
BOOST_STATIC_ASSERT(iter::type::value == 50);
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/list.html">list</a></code>, <code>max_element</code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 23, 2002 3:23 am</body></html>
+62
View File
@@ -0,0 +1,62 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/unique</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>unique</h1><h3>Synopsis
</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename Predicate = is_same&lt;_1,_2&gt;
&gt;
struct unique
{
typedef <em>implementation-defined</em> type;
};
</pre>
<p>
<h3>Description
</h3>
<p>
[to do]
<p>
<h3>Definition
</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/unique.hpp">boost/mpl/unique.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><th>&nbsp;Default argument &nbsp;</th></tr>
<tr><td><code>Param</code></td><td>A model of Concept</td><td>[to do]</td><td>[to do] </td></tr>
</table>
<p>
<h3>Members
</h3>
<table border="1">
<tr><th>&nbsp;Member&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>type</code></td><td>[to do] </td></tr>
</table>
<p>
<h3>Complexity
</h3>
<p>
[to do]
<p>
<h3>Example
</h3>
<p>
<pre>
[to do]
</pre>
<p>
<h3>See also
</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/erase.html">erase</a></code>, <code>erase_if</code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited February 19, 2002 4:15 am</body></html>
+60
View File
@@ -0,0 +1,60 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/upper bound</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>upper_bound</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence
, typename T
, typename Pred
&gt;
struct upper_bound
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the last position in the sorted <code>Sequence</code> where <code>T</code> could be inserted without violating the ordering.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/upper_bound.hpp">boost/mpl/upper_bound.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 sorted sequence. </td></tr>
<tr><td><code>T</code></td><td>A type</td><td>A type to search the position for. </td></tr>
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A sort 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 upper_bound&lt; Sequence,T,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 furthermost 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, i)</code>, <code>apply&lt; lambda&lt;Pred&gt;::type, T, j::type &gt;::type::value == false</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
The number of comparisons is logarithmic: at most <code>log(size&lt;Sequence&gt;::type::value) + 1</code>. If <code>Sequence</code> is a <a href="../Random_Access_Sequence.html">Random Access Sequence</a> then the number of steps through the range is also logarithmic; otherwise, the number of steps is proportional to <code>size&lt;Sequence&gt;::type::value</code>.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/list_c.html">list_c</a>&lt;int,1,2,3,3,3,5,8&gt; numbers;
typedef upper_bound&lt; numbers, int_c&lt;3&gt;, <a href="../Reference/less.html">less</a>&lt;_,_&gt; &gt;::type iter;
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>&lt; <a href="../Reference/begin.html">begin</a>&lt;numbers&gt;::type,iter &gt;::type::value == 5));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/sort.html">sort</a></code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 6:30 pm</body></html>
+77
View File
@@ -0,0 +1,77 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/vector</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>vector</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T1 = <em>implementation-defined</em>
, typename T2 = <em>implementation-defined</em>
, ...
, typename Tn = <em>implementation-defined</em>
&gt;
struct vector
{
};
</pre>
<p>
<h3>Description</h3>
<p>
An <code>vector</code> is a <a href="../Random_Access_Sequence.html">Random Access Sequence</a> of types. It's also an <a href="../Extensible_Sequence.html">Extensible Sequence</a> that supports constant time insertion and removal of elements at the end (through <code><a href="../Reference/push_back.html">push_back</a></code>), and linear time insertion and removal of elements at the beginning or in the middle (through <code><a href="../Reference/insert.html">insert</a></code>/<code><a href="../Reference/erase.html">erase</a></code> algorithms). On compilers that support the typeof extension, vector is the simplest and in many cases the most efficient sequence [<a href="#1">1</a>].
<p>
<h3>Example</h3>
<p>
<pre>
typedef vector&lt;float,double,long double&gt; floats;
typedef push_back&lt;floating_types,my_float&gt;::type ext_floats;
typedef at_c&lt;3,ext_floats&gt;::type my;
BOOST_STATIC_ASSERT((boost::is_same&lt;my,my_float&gt;::value));
</pre>
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/vector.hpp">boost/mpl/vector.hpp</a>"
#include "<a href="../../../../../\boost/mpl/vector/vector0.hpp">boost/mpl/vector/vector0.hpp</a>"
#include "<a href="../../../../../\boost/mpl/vector/vector10.hpp">boost/mpl/vector/vector10.hpp</a>"
...
#include "<a href="../../../../../\boost/mpl/vector/vector50.hpp">boost/mpl/vector/vector50.hpp</a>"
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>] The <code>typeof</code> operator allows one to use overload resolution to implement a constant-time random access to elements of the sequence with minimum amount of code (in contrast to the usual brute-force approach the library has to resort to when the <code>typeof</code> operator is not available):
<p>
<pre>
struct null_node
{
static aux::type_wrapper&lt;void_&gt; item(...);
};
<p>
template&lt; long N, typename T, typename Base &gt;
struct node
: Base
{
using Base::item;
static aux::type_wrapper&lt;T&gt; item(integral_c&lt;long,N&gt;);
};
<p>
template&lt; typename V, long N &gt;
struct at
{
typedef __typeof__(V::item(integral_c&lt;long,N&gt;())) wrapped_type_;
typedef typename wrapped_type_::type type;
};
<p>
typedef node&lt;1,char,node&lt;0,int,null_node&gt; &gt; v;
typedef at&lt;v,0&gt;::type t; <span class="cxx-comment">// constant-time random access!</span>
BOOST_STATIC_ASSERT((is_same&lt;t,int&gt;::value));
</pre>
<br>
<p>
<h3>See also</h3>
<p>
<a href="../Random_Access_Sequence.html">Random Access Sequence</a>, <code><a href="../Reference/vector_c.html">vector_c</a></code>, <code><a href="../Reference/list.html">list</a></code>, <code><a href="../Reference/list_c.html">list_c</a></code>, <code><a href="../Reference/range_c.html">range_c</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 22, 2002 4:28 pm</body></html>
+58
View File
@@ -0,0 +1,58 @@
<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::Reference/vector c</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Content.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>vector_c</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename T
, T C1 = <em>implementation-defined</em>
, T C2 = <em>implementation-defined</em>
, ...
, T CN = <em>implementation-defined</em>
&gt;
struct vector_c
{
};
</pre>
<p>
<h3>Description</h3>
<p>
<code>vector_c</code> is a shorcut interface whose whole purpose is to make the creation of a <code>vector</code> of <a href="../Integral_Constant.html">Integral Constant</a>s less verbose:
<p>
<pre>
typedef vector_c&lt;unsigned long,-1,0,1,1,-1,0,0,1,-1&gt; data;
</pre>
<p>
If <code>vector_c</code> didn't exist, instead of the above line you would have to write this:
<p>
<pre>
typedef vector&lt;
integral_c&lt;unsigned long,-1&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,-1&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,0&gt;
, integral_c&lt;unsigned long,1&gt;
, integral_c&lt;unsigned long,-1&gt;
&gt; data;
</pre>
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../\boost/mpl/vector_c.hpp">boost/mpl/vector_c.hpp</a>"
#include "<a href="../../../../../\boost/mpl/vector/vector0_c.hpp">boost/mpl/vector/vector0_c.hpp</a>"
#include "<a href="../../../../../\boost/mpl/vector/vector10_c.hpp">boost/mpl/vector/vector10_c.hpp</a>"
...
#include "<a href="../../../../../\boost/mpl/vector/vector50_c.hpp">boost/mpl/vector/vector50_c.hpp</a>"
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Random_Access_Sequence.html">Random Access Sequence</a>, <code><a href="../Reference/vector.html">vector</a></code>, <code><a href="../Reference/list.html">list</a></code>, <code><a href="../Reference/list_c.html">list_c</a></code>, <code><a href="../Reference/range_c.html">range_c</a></code>
<p><hr>
<a href="../Table_of_Content.html">Table of Content</a> | <a href="../Reference.html">Reference</a><br>Last edited July 17, 2002 8:01 am</body></html>