Added libs/mpl
[SVN r15384]
This commit is contained in:
1 parent
6ec072c403
commit
01d61922bc
238 files changed
+15885
No files matched your search
@@ -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<
|
||||
typename Iterator
|
||||
, typename N
|
||||
>
|
||||
struct advance
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns an new iterator <code>i</code> such as <code>distance< Iterator,i >::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef advance<Iterator,N>::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 > 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< Iterator,i >::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<int,0,1,2,3,4,5,6,7,8,9> numbers;
|
||||
typedef begin<numbers>::type first;
|
||||
typedef end<numbers>::type last;
|
||||
typedef advance_c<first,10>::type iter1;
|
||||
typedef advance_c<last,-10>::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>
|
||||
@@ -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<
|
||||
typename N
|
||||
, typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef at<N,Sequence>::type t;</code></td><td>A type</td><td><code>0 <= N::value < size<Sequence>::type::value</code></td><td>Equivalent to <code>typedef advance< begin<Sequence>::type,N >::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><long,10,50> range;
|
||||
BOOST_STATIC_ASSERT(at< int_c<0>, range >::type::value == 10);
|
||||
BOOST_STATIC_ASSERT(at< int_c<10>, range >::type::value == 20);
|
||||
BOOST_STATIC_ASSERT(at< int_c<40>, range >::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>
|
||||
@@ -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<
|
||||
long n
|
||||
, typename Sequence
|
||||
>
|
||||
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<n,Sequence>::type</code> is a shorcut notation for <code>at< integral_c<long,n>, Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef at_c<n,Sequence>::type t;</code></td><td>A type</td><td><code>0 <= n < size<Sequence>::type::value</code></td><td>Equivalent to <code>typedef at< integral_c<long,n>, Sequence>::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><long,10,50> range;
|
||||
BOOST_STATIC_ASSERT(at_c<0,range>::type::value == 10);
|
||||
BOOST_STATIC_ASSERT(at_c<10,range>::type::value == 20);
|
||||
BOOST_STATIC_ASSERT(at_c<40,range>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef back<Sequence>::type t;</code></td><td>A type</td><td><code>empty<Sequence>::type::value == false</code></td><td>Equivalent to <code>typedef prior< end<Sequence>::type >::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><int,0,1> range1;
|
||||
typedef range_c<int,0,10> range2;
|
||||
typedef range_c<int,-10,0> range3;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(back<range1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(back<range2>::type::value == 9);
|
||||
BOOST_STATIC_ASSERT(back<range3>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef begin<Sequence>::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<Sequence>::type::value == 0</code>. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef vector<unsigned char,unsigned short,unsigned int, unsigned long> unsigned_types;
|
||||
typedef begin<unsigned_types>::type iter;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<iter::type,unsigned char>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef clear<Sequence>::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<Sequence, begin<Sequence>::type, end<Sequence>::type>::type s;</code></td><td><code>empty<s>::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<int,1,3,5,7,9,11> odds;
|
||||
typedef clear<odds>::type nothing;
|
||||
BOOST_STATIC_ASSERT(empty<nothing>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef contains<Sequence,T>::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>< is_same< <a href="../Reference/find.html">find</a><Sequence,T>::type, <a href="../Reference/end.html">end</a><Sequence>::type > >::type c</code>; </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. At most <code>size<Sequence>::value</code> comparisons for identity.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><char,int,unsigned,long,unsigned long> types;
|
||||
typedef contains<types,bool>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BinaryOp
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef copy<Sequence,T,Op>::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold< Sequence,T,Op >::type s;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>BinaryOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector_c.html">vector_c</a><int,0,1,2,3,4,5,6,7,8,9> numbers;
|
||||
typedef copy<
|
||||
<a href="../Reference/range_c.html">range_c</a><int,10,20>
|
||||
, <a href="../Reference/push_back.html">push_back</a><_,_>
|
||||
, numbers
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result>::value == 20);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< result,<a href="../Reference/range_c.html">range_c</a><int,0,20> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BinaryOp
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef copy_backward<Sequence,T,Op>::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold_backward< Sequence,T,Op >::type s;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>BinaryOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,10,11,12,13,14,15,16,17,18,19>::type numbers;
|
||||
typedef copy_backward<
|
||||
<a href="../Reference/range_c.html">range_c</a><int,0,10>
|
||||
, <a href="../Reference/push_front.html">push_front</a><_,_>
|
||||
, numbers
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result>::value == 20);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< result,<a href="../Reference/range_c.html">range_c</a><int,0,20> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BinaryOp
|
||||
, typename Pred
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef copy_backward_if<Sequence,T,Op,Pred>::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<Op>::type op; typedef lambda<Pred>::type pred; typedef fold_backward< Sequence,T,if_< apply<pred,_2>, apply<op,_1,_2>, _1 > >::type s;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>BinaryOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,0,1,2,3,4,5,6,7,8,9>::type numbers;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,0,1,2,3,4>::type answer;
|
||||
typedef copy_backward_if<
|
||||
numbers
|
||||
, <a href="../Reference/list_c.html">list_c</a><int>
|
||||
, <a href="../Reference/push_front.html">push_front</a><_,_>
|
||||
, <a href="../Reference/less.html">less</a><_,int_c<5> >
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result>::value == 5);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a><result,answer>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BinaryOp
|
||||
, typename Pred
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef copy_if<Sequence,T,Op,Pred>::type s;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<Op>::type op; typedef lambda<Pred>::type pred; typedef fold< Sequence,T,if_< apply<pred,_2>, apply<op,_1,_2>, _1 > >::type s;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>BinaryOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,0,1,2,3,4,5,6,7,8,9>::type numbers;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,0,1,2,3,4>::type answer;
|
||||
typedef copy_if<
|
||||
numbers
|
||||
, <a href="../Reference/vector_c.html">vector_c</a><int>
|
||||
, <a href="../Reference/push_back.html">push_back</a><_,_>
|
||||
, <a href="../Reference/less.html">less</a><_,int_c<5> >
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result>::value == 5);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a><result,answer>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef count<Sequence,T>::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>< Sequence,is_same<_,T> >::type n;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::value</code> comparisons for identity.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><int,char,long,short,char,short,double,long> types;
|
||||
typedef find<types, short>::type iter;
|
||||
BOOST_STATIC_ASSERT((is_same<iter::type,short>::type::value));
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>< begin<types>::type,iter >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef count_if<Sequence,Pred>::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<Pred>::type pred; typedef <a href="../Reference/fold.html">fold</a>< Sequence,integral_c<unsigned long,0>,if_<pred,<a href="../Reference/next.html">next</a><_1>,_1> >::type n;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::value</code> applications of <code>Pred</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><int,char,long,short,char,long,double,long> types;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((count_if< types,boost::is_float<_> >::type::value == 1));
|
||||
BOOST_STATIC_ASSERT((count_if< types,boost::is_same<_,char> >::type::value == 2));
|
||||
BOOST_STATIC_ASSERT((count_if< types,boost::is_same<_,void> >::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>
|
||||
@@ -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<
|
||||
typename First
|
||||
, typename Last
|
||||
>
|
||||
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< First,D >::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef distance<First,Last>::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< advance< First,d >::type, Last >::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<int,0,10>::type range;
|
||||
BOOST_STATIC_ASSERT((distance< begin<range>::type,end<range>::type >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
, typaname T3 = integral_c<int,1>
|
||||
, ...
|
||||
, typaname Tn = integral_c<int,1>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef divides<t1,t2,..,tn>::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<typeof(t1::value / t2::value .. / tn::value), t1::value / t2::value .. / tn::value > quot;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef divides< integral_c<short,-10>, integral_c<long,3> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef empty<Sequence>::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< begin<Sequence>::type,end<Sequence>::type >::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<int,0,0> empty_range;
|
||||
typedef list<long,float,double> types;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(empty<empty_range>::value)
|
||||
BOOST_STATIC_ASSERT(!empty<types>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef end<Sequence>::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><long> short_list;
|
||||
typedef <a href="../Reference/begin.html">begin</a><short_list>::type first;
|
||||
typedef end<short_list>::type last;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<first::next,last>::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>
|
||||
@@ -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<
|
||||
typename Sequence1
|
||||
, typename Sequence2
|
||||
, typename Pred = is_same<_,_>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef equal<Sequence1,Sequence2,Pred>::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<Sequence1>::type::value == size<Sequence2>::type::value</code> and for every iterator <code>i</code> in <code>[begin<Sequence>::type,end<Sequence>::type)</code> <code>i::type</code> is identical to <code>advance< begin<Sequence2>::type, distance< begin<Sequence1>::type,i >::type >::type</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. At most <code>size<Sequence1>::value</code> comparisons.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><char,int,unsigned,long,unsigned long> s1;
|
||||
typedef <a href="../Reference/list.html">list</a><char,int,unsigned,long,unsigned long> s2;
|
||||
BOOST_STATIC_ASSERT((equal<s1,s2>::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef equal_to<t1,t2>::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<(t1::value == t2::value)> 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><int,1,2,3,5,7,12,19,31> fibonacci;
|
||||
typedef <a href="../Reference/find_if.html">find_if</a>< fibonacci, equal_to<_,int_c<12> > >::type iter;
|
||||
BOOST_STATIC_ASSERT(equal_to< <a href="../Reference/distance.html">distance</a>< <a href="../Reference/begin.html">begin</a><fibonacci>::type, iter >::type, int_c<5> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename First
|
||||
, typename Last = typename First::next
|
||||
>
|
||||
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<Sequence>::type, First)</code> and <code>[Last, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </th><th> Default value </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef erase<Sequence,pos>::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<Sequence>::type, pos)</code> and <code>[next<pos>::type, end<Sequence>::type)</code>.</td><td><code>size<s>::type::value == size<Sequence>::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<Sequence,first,last>::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<Sequence>::type, first)</code> and <code>[last, end<Sequence>::type)</code>.</td><td><code>size<s>::type::value == size<Sequence>::type::value - distance<first,last>::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><int,1,0,5,1,7,5,0,5> values;
|
||||
typedef <a href="../Reference/find.html">find</a>< values, integral_c<int,7> >::type pos;
|
||||
typedef erase<values,pos>::type result_seq;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result_seq>::type::value == 7);
|
||||
<p>
|
||||
typedef find<result, integral_c<int,7> >::type result_iter;
|
||||
BOOST_MPL_ASSERT_IS_SAME(result_iter, <a href="../Reference/end.html">end</a><result_seq>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Predicate
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename First
|
||||
, typename Last
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef filter_view<Sequence,Pred> 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><Sequence>::type,<a href="../Reference/end.html">end</a><Sequence>::type)</code> that satisfy the predicate <code>Pred</code>.</td><td><code><a href="../Reference/size.html">size</a><s>::type::value == <a href="../Reference/count_if.html">count_if</a>< Sequence,Pred >::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><int,float,long,float,char[50],long double,char> types;
|
||||
typedef max_element<
|
||||
<a href="../Reference/transform_view.html">transform_view</a>< filter_view< types,boost::is_float<_> >, size_of<_> >
|
||||
>::type iter;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((is_same<iter::base::type,long double>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef find<Sequence,T>::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><Sequence, is_same<_,T> >::type i</code>; </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. At most <code>size<Sequence>::value</code> comparisons for identity.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><char,int,unsigned,long,unsigned long> types;
|
||||
typedef find<types,unsigned>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef find_if<Sequence,Pred>::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<Sequence>::type, end<Sequence>::type)</code> such that <code>apply< lambda<Pred>::type,i::type >::type::value == true</code>; <code>i</code> is identical to <code>end<Sequence>::type</code>, if no such iterator exists.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. At most <code>size<Sequence>::value</code> applications of <code>Pred</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><char,int,unsigned,long,unsigned_long> types;
|
||||
typedef find_if<types, is_same<_1,unsigned> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef fold<Sequence,T,Op>::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<Op>::type op; typedef iter_fold< Sequence,T,apply<op,_1,deref<_2> > >::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>ForwardOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><long,float,short,double,float,long,long double> types;
|
||||
typedef typename fold<
|
||||
types
|
||||
, integral_c<long, 0>
|
||||
, if_< is_float<_2>,<a href="../Reference/next.html">next</a><_1>,_1 >
|
||||
>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp = _1
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </th><th> Default value </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<1></code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef fold_backward< Sequence,T,BackwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<BackwardOp>::type bk_op; typedef begin<Sequence>::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply<bk_op,T,in::type>::type tn; typedef apply<bk_op,tn,in-1::type>::type tn-1; ...; typedef apply<bk_op,t2,i1::type>::type t1; typedef t1 t</code>, where <code>n == size<Sequence>::type::value</code> and <code>last</code> is identical to <code>end<Sequence>::type</code>; Equivalent to <code>typedef T t;</code> if the sequence is empty.</td><td></td></tr>
|
||||
<tr><td><code>typedef fold_backward< Sequence,T,BackwardOp,ForwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef fold_backward<Sequence, fold<Sequence,State,ForwardOp>::type, BackwardOp>::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::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><int,5,-1,0,-7,-2,0,-5,4> numbers;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,-1,-7,-2,-5> negatives;
|
||||
typedef fold_backward<
|
||||
numbers
|
||||
, <a href="../Reference/list_c.html">list_c</a><int>
|
||||
, if_< <a href="../Reference/less.html">less</a>< _2,int_c<0> >, push_front<_1,_2,>, _1 >
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< negatives,result,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef front<Sequence>::type t;</code></td><td>A type</td><td><code>empty<Sequence>::type::value == false</code></td><td>Equivalent to <code>typedef begin<Sequence>::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><long>::type types1;
|
||||
typedef list<int,long>::type types2;
|
||||
typedef list<char,int,long>::type types3;
|
||||
<p>
|
||||
BOOST_MPL_ASSERT_IS_SAME(front<types1>::type, long);
|
||||
BOOST_MPL_ASSERT_IS_SAME(front<types2>::type, int);
|
||||
BOOST_MPL_ASSERT_IS_SAME(front<types3>::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
struct greater
|
||||
{
|
||||
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/greater.hpp">boost/mpl/comparison/greater.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef greater<t1,t2>::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<(t1::value > t2::value)> 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><int,1,2,3,5,7,12,19,31> fibonacci;
|
||||
typedef <a href="../Reference/find_if.html">find_if</a>< fibonacci, greater<_,int_c<10> > >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
struct greater_equal
|
||||
{
|
||||
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/greater_equal.hpp">boost/mpl/comparison/greater_equal.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef greater_equal<t1,t2>::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<(t1::value >= t2::value)> 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><int,0,1,2,3,4,5,6,7,8,9> numbers;
|
||||
typedef <a href="../Reference/remove_if.html">remove_if</a>< numbers, greater_equal<_,int_c<5> > >::type result;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< result,<a href="../Reference/range_c.html">range_c</a><int,0,5>,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pos
|
||||
, typename T
|
||||
>
|
||||
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< begin<Sequence>::type,Pos >::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef insert<Sequence,pos,T>::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< begin<Sequence>::type,pos >::type</code> position.</td><td><code>size<s>::type::value == size<Sequence>::type::value + 1</code>; <code>at< distance< begin<Sequence>::type,pos >::type, s >::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><int,0,1,3,4,5,6,7,8,9> numbers;
|
||||
typedef <a href="../Reference/find.html">find</a>< numbers,integral_c<int,3> >::type pos;
|
||||
typedef insert< numbers,pos,integral_c<int,2> >::type range;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><range>::type::value == 10);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< range,<a href="../Reference/range_c.html">range_c</a><int,0,10> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pos
|
||||
, typename Range
|
||||
>
|
||||
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< begin<Sequence>::type,Pos >::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef insert<Sequence,pos,range>::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< begin<Sequence>::type,pos >::type</code> position.</td><td><code>size<s>::type::value == size<Sequence>::type::value + size<range>::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><int,0,1,7,8,9> numbers;
|
||||
typedef <a href="../Reference/find.html">find</a>< numbers,integral_c<int,7> >::type pos;
|
||||
typedef insert_range< numbers,pos,<a href="../Reference/range_c.html">range_c</a><int,2,7> >::type range;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><range>::type::value == 10);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< range,<a href="../Reference/range_c.html">range_c</a><int,0,10> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename ForwardOp
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef iter_fold<Sequence,T,Op>::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<Op>::type op; typedef begin<Sequence>::type i1; typedef apply<op,T,i1>::type t1; typedef i1::next i2; typedef apply<op,t1,i2>::type t2; ...; typedef apply<op,T,in>::type tn; typedef in::next last; typedef tn t</code>, where <code>n == size<Sequence>::type::value</code> and <code>last</code> is identical to <code>end<Sequence>::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><Sequence>::type::value</code> applications of <code>ForwardOp</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,5,-1,0,7,2,0,-5,4> numbers;
|
||||
typedef iter_fold<
|
||||
numbers
|
||||
, <a href="../Reference/begin.html">begin</a><numbers>::type
|
||||
, if_< <a href="../Reference/less.html">less</a>< deref<_1>, deref<_2> >,_2,_1 >
|
||||
>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp = _1
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </th><th> Default value </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<1></code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef iter_fold_backward< Sequence,T,BackwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<BackwardOp>::type bk_op; typedef begin<Sequence>::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply<bk_op,T,in>::type tn; typedef apply<bk_op,tn,in-1>::type tn-1; ...; typedef apply<bk_op,t2,i1>::type t1; typedef t1 t</code>, where <code>n == size<Sequence>::type::value</code> and <code>last</code> is identical to <code>end<Sequence>::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< Sequence,T,BackwardOp,ForwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef iter_fold_backward<Sequence, iter_fold<Sequence,State,ForwardOp>::type, BackwardOp>::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::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><int,5,-1,0,-7,-2,0,-5,4> numbers;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,-1,-7,-2,-5> negatives;
|
||||
typedef iter_fold_backward<
|
||||
numbers
|
||||
, <a href="../Reference/list.html">list</a><>
|
||||
, if_< <a href="../Reference/less.html">less</a>< deref<_2>,int_c<0> >, push_front<_1,_2>, _1 >
|
||||
>::type iters;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< negatives, <a href="../Reference/transform_view.html">transform_view</a>< iters,deref<_> >, <a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename State
|
||||
, typename BackwardOp
|
||||
, typename ForwardOp = _1
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </th><th> Default value </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<1></code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef iter_fold_backward< Sequence,T,BackwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef lambda<BackwardOp>::type bk_op; typedef begin<Sequence>::type i1; typedef i1::next i2; ...; typedef in::next last; typedef apply<bk_op,T,in>::type tn; typedef apply<bk_op,tn,in-1>::type tn-1; ...; typedef apply<bk_op,t2,i1>::type t1; typedef t1 t</code>, where <code>n == size<Sequence>::type::value</code> and <code>last</code> is identical to <code>end<Sequence>::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< Sequence,T,BackwardOp,ForwardOp >::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef iter_fold_backward<Sequence, iter_fold<Sequence,State,ForwardOp>::type, BackwardOp>::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>::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><int,5,-1,0,7,2,0,-5,4> numbers;
|
||||
typedef iter_fold_backward<
|
||||
numbers
|
||||
, <a href="../Reference/end.html">end</a><numbers>::type
|
||||
, if_< <a href="../Reference/less.html">less</a>< deref<_2>, int_c<0> >,_2,_1 >
|
||||
>::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>
|
||||
@@ -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<
|
||||
typename Iterator
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef iterator_category<Iterator>::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< typename Iterator >
|
||||
struct my_algorithm
|
||||
: my_algorithm_impl<
|
||||
iterator_category<Iterator>::type
|
||||
, Iterator
|
||||
>
|
||||
{
|
||||
};
|
||||
</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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
struct less
|
||||
{
|
||||
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/less.hpp">boost/mpl/comparison/less.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef less<t1,t2>::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<(t1::value < t2::value)> 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><int,0,1,2,3,4,5,6,7,8,9> numbers;
|
||||
typedef <a href="../Reference/remove_if.html">remove_if</a>< numbers, less<_,int_c<5> > >::type result;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< result,<a href="../Reference/range_c.html">range_c</a><int,5,10>,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
struct less_equal
|
||||
{
|
||||
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/less_equal.hpp">boost/mpl/comparison/less_equal.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef less_equal<t1,t2>::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<(t1::value <= t2::value)> 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><int,0,1,2,3,4,5,6,7,8,9> numbers;
|
||||
typedef <a href="../Reference/remove_if.html">remove_if</a>< numbers, less_equal<_,int_c<4> > >::type result;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< result,<a href="../Reference/range_c.html">range_c</a><int,5,10>,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename T1 = <em>implementation-defined</em>
|
||||
, typename T2 = <em>implementation-defined</em>
|
||||
, ...
|
||||
, typename Tn = <em>implementation-defined</em>
|
||||
>
|
||||
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<float,double,long double> floats;
|
||||
typedef <a href="../Reference/push_front.html">push_front</a><floating_types,my_float>::type ext_floats;
|
||||
BOOST_STATIC_ASSERT((boost::is_same< <a href="../Reference/front.html">front</a><ext_floats>::type, my_float >::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
, T C1 = <em>implementation-defined</em>
|
||||
, T C2 = <em>implementation-defined</em>
|
||||
, ...
|
||||
, T CN = <em>implementation-defined</em>
|
||||
>
|
||||
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<unsigned long,-1,0,1,1,-1,0,0,1,-1> 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<
|
||||
integral_c<unsigned long,-1>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,-1>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,-1>
|
||||
> 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>
|
||||
@@ -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<
|
||||
typename F1
|
||||
, typename F2
|
||||
, typename F3 = true_c
|
||||
...
|
||||
, typename Fn = true_c
|
||||
>
|
||||
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>&&</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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef logical_and<f1,f2,..,fn>::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< typename T > struct fail
|
||||
{
|
||||
typedef typename T::nonexistent type;
|
||||
};
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((logical_and< true_c,false_c >::type::value == false));
|
||||
BOOST_STATIC_ASSERT((logical_and< false_c,fail<int> >::type::value == false)); <span class="cxx-comment">// ok, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((logical_and< true_c,false_c,fail<int> >::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>
|
||||
@@ -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<
|
||||
typename F
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef logical_not<f>::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<(!f::type::value)> c;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
BOOST_STATIC_ASSERT(logical_not<true_c>::type::value == false);
|
||||
BOOST_STATIC_ASSERT(logical_not<false_c>::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>
|
||||
@@ -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<
|
||||
typename F1
|
||||
, typename F2
|
||||
, typename F3 = false_c
|
||||
...
|
||||
, typename Fn = false_c
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef logical_or<f1,f2,..,fn>::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< typename T > struct fail
|
||||
{
|
||||
typedef typename T::nonexistent type;
|
||||
};
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((logical_or< false_c,true_c >::type::value == true));
|
||||
BOOST_STATIC_ASSERT((logical_or< true_c,fail<int> >::type::value == true)); <span class="cxx-comment">// ok, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((logical_or< false_c,true_c,fail<int> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
, typename Pred
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef lower_bound< Sequence,T,Pred >::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<Sequence>::type, end<Sequence>::type)</code> such that, for every iterator <code>j</code> in <code>[begin<Sequence>::type, i)</code>, <code>apply< lambda<Pred>::type, j::type, T >::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<Sequence>::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<Sequence>::type::value</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,2,3,3,3,5,8> numbers;
|
||||
typedef lower_bound< numbers, int_c<3>, <a href="../Reference/less.html">less</a><_,_> >::type iter;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>< <a href="../Reference/begin.html">begin</a><numbers>::type,iter >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
, typaname T3 = integral_c<int,0>
|
||||
, ...
|
||||
, typaname Tn = integral_c<int,0>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef minus<t1,t2,..,tn>::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<typeof(t1::value - t2::value .. - tn::value), t1::value - t2::value .. - tn::value > diff;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef minus< integral_c<short,-1>, integral_c<long,10> >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef modulus<t1,t2>::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<typeof(t1::value % t2::value), t1::value % t2::value> mod;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef modulus< integral_c<short,10>, integral_c<long,3> >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
, typaname T3 = integral_c<int,1>
|
||||
, ...
|
||||
, typaname Tn = integral_c<int,1>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef multiplies<t1,t2,..,tn>::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<typeof(t1::value * t2::value .. * tn::value), t1::value * t2::value .. * tn::value > product;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef multiplies< integral_c<short,-1>, integral_c<long,10> >::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef negate<t>::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<t::value_type, -t::value> n;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef negate< integral_c<short,-10> >::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef not_equal_to<t1,t2>::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<(t1::value != t2::value)> 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><int,1,5,0,7,5,-1,2,4,5> numbers;
|
||||
typedef <a href="../Reference/remove_if.html">remove_if</a>< numbers, not_equal_to<_,int_c<5> > >::type fives;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal_to.html">equal_to</a>< <a href="../Reference/count_if.html">count_if</a>< fives, <a href="../Reference/equal_to.html">equal_to</a><_,int_c<5> > >::type, <a href="../Reference/size.html">size</a><fives>::type >::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>
|
||||
@@ -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<
|
||||
typename T1
|
||||
, typaname T2
|
||||
, typaname T3 = integral_c<int,0>
|
||||
, ...
|
||||
, typaname Tn = integral_c<int,0>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef plus<t1,t2,..,tn>::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<typeof(t1::value + t2::value .. + tn::value), t1::value + t2::value .. + tn::value > sum;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef plus< integral_c<short,-1>, integral_c<long,10> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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<Sequence>::type, prior< end<Sequence>::type >::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef pop_back<Sequence>::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>empty<Sequence>::type::value == false</code></td><td>Equivalent to <code>typedef erase< Sequence, prior< end<Sequence>::type >::type >::type s;</code></td><td><code>size<s>::type::value == size<Sequence>::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><long>::type types1;
|
||||
typedef list<long,int>::type types2;
|
||||
typedef list<long,int,char>::type types3;
|
||||
<p>
|
||||
typedef pop_back<types1>::type result1;
|
||||
typedef pop_back<types2>::type result2;
|
||||
typedef pop_back<types3>::type result3;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(size<result2>::type::value == 1);
|
||||
BOOST_STATIC_ASSERT(size<result3>::type::value == 2);
|
||||
<p>
|
||||
BOOST_MPL_ASSERT_IS_SAME(<a href="../Reference/back.html">back</a><result2>::type, long);
|
||||
BOOST_MPL_ASSERT_IS_SAME(back<result3>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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< begin<Sequence>::type >::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef pop_front<Sequence>::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td><code>empty<Sequence>::type::value == false</code></td><td>Equivalent to <code>typedef erase< Sequence, begin<Sequence>::type >::type s;</code></td><td><code>size<s>::type::value == size<Sequence>::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><long>::type types1;
|
||||
typedef <a href="../Reference/list.html">list</a><int,long>::type types2;
|
||||
typedef <a href="../Reference/list.html">list</a><char,int,long>::type types3;
|
||||
<p>
|
||||
typedef pop_front<types1>::type result1;
|
||||
typedef pop_front<types2>::type result2;
|
||||
typedef pop_front<types3>::type result3;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(size<result2>::type::value == 1);
|
||||
BOOST_STATIC_ASSERT(size<result3>::type::value == 2);
|
||||
<p>
|
||||
BOOST_MPL_ASSERT_IS_SAME(<a href="../Reference/front.html">front</a><result2>::type, long);
|
||||
BOOST_MPL_ASSERT_IS_SAME(front<result3>::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef push_back<Sequence,T>::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td>Equivalent to <code>typedef insert< Sequence,end<Sequence>::type,T >::type s;</code></td><td><code>size<s>::type::value == size<Sequence>::type::value + 1</code>; <code>back<s>::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><bool,false,false,false,true,true,true,false,false> bools;
|
||||
typedef push_back<bools,false_c>::type message;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/back.html">back</a><message>::type::value == false);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/count_if.html">count_if</a><message, <a href="../Reference/equal_to.html">equal_to</a><_,false_c> >::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< Sequence,end<Sequence>::type,T >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef push_front<Sequence,T>::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< Sequence,begin<Sequence>::type,T >::type s;</code></td><td><code>size<s>::type::value == size<Sequence>::type::value + 1</code>; <code>front<s>::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><int,1,2,3,5,8,13,21> something;
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><something>::type::value == 7);
|
||||
typedef <a href="../Reference/push_front.html">push_front</a>< something,integral_c<int,1> >::type fibonacci;
|
||||
BOOST_STATIC_ASSERT(size<fibonacci>::type::value == 8);
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< fibonacci,list_c<int,1,1,2,3,5,8,13,21>,equal_to<_,_> >::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< Sequence,begin<Sequence>::type,T >::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
, T Start
|
||||
, T Finish
|
||||
>
|
||||
struct range_c
|
||||
{
|
||||
typedef integral_c<T,Start> start;
|
||||
typedef integral_c<T,Finish> 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<int,0,0> range0;
|
||||
typedef range_c<int,0,1> range1;
|
||||
typedef range_c<int,0,10> range10;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(size<range0>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(size<range1>::type::value == 1);
|
||||
BOOST_STATIC_ASSERT(size<range10>::type::value == 10);
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(empty<range0>::type::value);
|
||||
BOOST_STATIC_ASSERT(!empty<range1>::type::value);
|
||||
BOOST_STATIC_ASSERT(!empty<range10>::type::value);
|
||||
<p>
|
||||
BOOST_MPL_ASSERT_IS_SAME(begin<range0>::type, end<range0>::type);
|
||||
BOOST_MPL_ASSERT_NOT_SAME(begin<range1>::type, end<range1>::type);
|
||||
BOOST_MPL_ASSERT_NOT_SAME(begin<range10>::type, end<range10>::type);
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(front<range1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(back<range1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(front<range10>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(back<range10>::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<
|
||||
range_c<int,0,50>
|
||||
, <a href="../Reference/push_back.html">push_back</a><_,_>
|
||||
, vector<>
|
||||
>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
>
|
||||
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<Sequence>::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef remove<Sequence,T>::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< Sequence,is_same<_,T> >::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Performs exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> comparisons for equality.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><int,float,char,float,float,double>::type types;
|
||||
typedef remove< types,float >::type result;
|
||||
typedef <a href="../Reference/list.html">list</a><int,char,double>::type answer;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< result,answer >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
>
|
||||
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<Sequence>::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef remove_if<Sequence,Pred>::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><Sequence>::type::value</code> applications of <code>Pred</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,4,5,2,7,5,3,5>::type numbers;
|
||||
typedef remove_if< numbers, greater<_,4> >::type result;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,4,2,3>::type answer;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< answer,result,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename OldType
|
||||
, typename NewType
|
||||
>
|
||||
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<Sequence>::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef replace<Sequence,OldType,NewType>::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< Sequence,NewType,is_same<_,OldType> >::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Performs exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> comparisons for equality, and at most <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> insertions.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><int,float,char,float,float,double>::type types;
|
||||
typedef replace< types,float,double >::type result;
|
||||
typedef <a href="../Reference/list.html">list</a><int,double,char,double,double,double>::type answer;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< result,answer >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
, typename NewType
|
||||
>
|
||||
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<Sequence>::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef replace_if<Sequence,Pred,NewType>::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<Pred>::type pred; typedef transform< Sequence, if_< apply1<pred,_1>,NewType,_1> >::type t;</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Performs exactly <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>Pred</code>, and at most <code><a href="../Reference/size.html">size</a><Sequence>::type::value</code> insertions.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,4,5,2,7,5,3,5>::type numbers;
|
||||
typedef replace_if< numbers, greater<_,4>, int_c<0> >::type result;
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,4,0,2,0,0,3,0>::type answer;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< answer,result,<a href="../Reference/equal_to.html">equal_to</a><_,_> >::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
>
|
||||
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<Sequence>::type,end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef size<Sequence>::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< begin<Sequence>::type,end<Sequence>::type >::type s;</code></td><td><code>s::value >= 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<Sequence>::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<> empty_list;
|
||||
typedef vector_c<int,0,1,2,3,4,5> numbers;
|
||||
typedef range_c<int,0,100> more_numbers;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(size<list>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(size<numbers>::type::value == 5);
|
||||
BOOST_STATIC_ASSERT(size<more_numbers>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Compare = less<_1,_2>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Op
|
||||
>
|
||||
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<Sequence>::type, end<Sequence>::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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef transform<Sequence,Op>::type s;</code></td><td>A model of <a href="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td></td><td><code>size<s>::type::value == size<Sequence>::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><Sequence>::type::value</code> times.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><char,short,int,long,float,double> types;
|
||||
typedef <a href="../Reference/list.html">list</a><char*,short*,int*,long*,float*,double*> pointers;
|
||||
typedef transform< types,boost::add_pointer<_1> >::type result;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a><result,pointers>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename F
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef transform_view<Sequence,F> 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><s>::type, <a href="../Reference/end.html">end</a><s>::type)</code> and for each <code>j</code> in <code>[<a href="../Reference/begin.html">begin</a><Sequence>::type, <a href="../Reference/end.html">end</a><Sequence>::type)</code> <code>i::type</code> is identical to <code>apply< lambda<F>::type, j::type >::type</code>.</td><td><code><a href="../Reference/size.html">size</a><Sequence>::type::value == <a href="../Reference/size.html">size</a><s>::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><int,long,char,char[50],double> types;
|
||||
typedef max_element<
|
||||
transform_view< types, size_of<_> >
|
||||
>::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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename Predicate = is_same<_1,_2>
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </th><th> Default argument </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> Member </th><th> Description </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>
|
||||
@@ -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<
|
||||
typename Sequence
|
||||
, typename T
|
||||
, typename Pred
|
||||
>
|
||||
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef upper_bound< Sequence,T,Pred >::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<Sequence>::type, end<Sequence>::type)</code> such that, for every iterator <code>j</code> in <code>[begin<Sequence>::type, i)</code>, <code>apply< lambda<Pred>::type, T, j::type >::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<Sequence>::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<Sequence>::type::value</code>.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,1,2,3,3,3,5,8> numbers;
|
||||
typedef upper_bound< numbers, int_c<3>, <a href="../Reference/less.html">less</a><_,_> >::type iter;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>< <a href="../Reference/begin.html">begin</a><numbers>::type,iter >::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>
|
||||
@@ -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<
|
||||
typename T1 = <em>implementation-defined</em>
|
||||
, typename T2 = <em>implementation-defined</em>
|
||||
, ...
|
||||
, typename Tn = <em>implementation-defined</em>
|
||||
>
|
||||
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<float,double,long double> floats;
|
||||
typedef push_back<floating_types,my_float>::type ext_floats;
|
||||
typedef at_c<3,ext_floats>::type my;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<my,my_float>::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<void_> item(...);
|
||||
};
|
||||
<p>
|
||||
template< long N, typename T, typename Base >
|
||||
struct node
|
||||
: Base
|
||||
{
|
||||
using Base::item;
|
||||
static aux::type_wrapper<T> item(integral_c<long,N>);
|
||||
};
|
||||
<p>
|
||||
template< typename V, long N >
|
||||
struct at
|
||||
{
|
||||
typedef __typeof__(V::item(integral_c<long,N>())) wrapped_type_;
|
||||
typedef typename wrapped_type_::type type;
|
||||
};
|
||||
<p>
|
||||
typedef node<1,char,node<0,int,null_node> > v;
|
||||
typedef at<v,0>::type t; <span class="cxx-comment">// constant-time random access!</span>
|
||||
BOOST_STATIC_ASSERT((is_same<t,int>::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>
|
||||
@@ -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<
|
||||
typename T
|
||||
, T C1 = <em>implementation-defined</em>
|
||||
, T C2 = <em>implementation-defined</em>
|
||||
, ...
|
||||
, T CN = <em>implementation-defined</em>
|
||||
>
|
||||
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<unsigned long,-1,0,1,1,-1,0,0,1,-1> 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<
|
||||
integral_c<unsigned long,-1>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,-1>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,0>
|
||||
, integral_c<unsigned long,1>
|
||||
, integral_c<unsigned long,-1>
|
||||
> 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>
|
||||
Reference in new issue
Block a user