mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 22:34:31 +02:00
update reference docs
[SVN r20792]
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
<html><head><title>boost::mpl::Acknowledgements</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Acknowledgements</h1>The format and language of this reference documentation has been greatly influenced by the SGI's <a href="http://www.sgi.com/tech/stl/">[Standard Template Library Programmer's Guide]</a>.
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Acknowledgements</h1>The format and language of this reference documentation has been greatly influenced by the SGI's <a href="http://www.sgi.com/tech/stl/">Standard Template Library Programmer's Guide</a>.
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 9:04 am</body></html>
|
58
doc/ref/Associative_Sequence.html
Normal file
58
doc/ref/Associative_Sequence.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Associative Sequence</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Associative Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
An Associative Sequence is a <a href="./Sequence.html">Sequence</a> which allows efficient retrieval of elements based on keys. For some of associative sequences such as <code>set</code> it is guaranteed that no two elements have the same key. Others, such as <code>multiset</code>, allow multiple elements with the same key.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Sequence.html">Sequence</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
In addition to <a href="./Sequence.html">Sequence</a>'s expressions the following expressions are valid.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>has_key<s,k>::type</code></td><td>A model of boolean <a href="./Integral_Constant.html">Integral Constant</a> </td></tr>
|
||||
<tr><td><code>count<s,k>::type</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> </td></tr>
|
||||
<tr><td><code>order<s,k>::type</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> or <code>void_</code> </td></tr>
|
||||
<tr><td><code>at<s,k>::type</code></td><td>A type </td></tr>
|
||||
<tr><td><code>at<s,k,default>::type</code></td><td>A type </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Complexity </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>has_key<s,k>::type</code></td><td>Amortized constant time</td><td></td><td></td><td></td></tr>
|
||||
<tr><td><code>count<s,k>::type</code></td><td>Amortized constant time</td><td></td><td></td><td></td></tr>
|
||||
<tr><td><code>order<s,k>::type</code></td><td>Amortized constant time</td><td></td><td></td><td></td></tr>
|
||||
<tr><td><code>at<s,k>::type</code></td><td>Amortized constant time</td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any associative sequence <code>s</code> the following invariants always hold:
|
||||
<ul>
|
||||
<li>TODO
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code>set</code>
|
||||
<li><code>map</code>
|
||||
<li><code>set_c</code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Sequences.html">Sequences</a>, <a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Extensible_Associative_Sequence.html">Extensible Associative Sequence</a>,
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited October 25, 2003 7:40 am</body></html>
|
47
doc/ref/Extensible_Associative_Sequence.html
Normal file
47
doc/ref/Extensible_Associative_Sequence.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Extensible Associative Sequence</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Extensible Associative Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
An Extensible Associative Sequence is an <a href="./Associative_Sequence.html">Associative Sequence</a> that supports insertion and removal of elements. In contrast to <a href="./Extensible_Sequence.html">Extensible Sequence</a>, Extensible Associative Sequence does not provide a mechanism for inserting an element <em>at a specific position</em>.
|
||||
<p>
|
||||
Refinement of
|
||||
<p>
|
||||
<a href="./Associative_Sequence.html">Associative Sequence</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename clear<s>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename insert<s,t>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename remove<s,k>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
TODO.
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any associative sequence <code>s</code> the following invariants always hold:
|
||||
<ul>
|
||||
<li>TODO
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code>set</code>
|
||||
<li><code>map</code>
|
||||
<li><code>set_c</code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Sequences.html">Sequences</a>, <a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Associative_Sequence.html">Associative Sequence</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited May 2, 2003 8:24 am</body></html>
|
@@ -15,7 +15,7 @@ An Extensible Sequence is either a <a href="./Forward_Sequence.html">Forward Seq
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename clear<s>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename insert<s,pos,T>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename insert<s,pos,t>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename erase<s,pos>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
<tr><td><code>typename erase<s,first,last>::type</code></td><td>A model of concept of <code>s</code> </td></tr>
|
||||
</table>
|
||||
@@ -37,4 +37,4 @@ See the description of <a href="./Reference/clear.html">clear</a>, <a href="./Re
|
||||
<p>
|
||||
<a href="./Sequences.html">Sequences</a>, <code><a href="./Reference/clear.html">clear</a></code>, <code><a href="./Reference/insert.html">insert</a></code>, <code><a href="./Reference/erase.html">erase</a></code>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 16, 2002 6:27 pm</body></html>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited May 2, 2003 4:54 am</body></html>
|
@@ -16,7 +16,7 @@ An Input Iterator is a <a href="./Trivial_Iterator.html">Trivial Iterator</a> th
|
||||
<li>an input iterator is <em>past-the-end</em> if it points beyond the last element of a sequence; past-the-end iterators are non-dereferenceable;
|
||||
<li>an input iterator is <em>valid</em> if it is dereferenceable or past-the-end;
|
||||
<li>an input iterator <code>i</code> is <em>incrementable</em> if there is a "next" iterator, that is, if <code>i::next</code> expression is well-defined; past-the-end iterators are not incrementable;
|
||||
<li>an input iterator <code>j</code> is <em>reachable</em> from a forward iterator <code>i</code> if, after recursive application of <code>next</code> operation to <code>i</code> a finite number of times, <code>i</code> is identical to <code>j</code>;
|
||||
<li>an input iterator <code>j</code> is <em>reachable</em> from an input iterator <code>i</code> if, after recursive application of <code>next</code> operation to <code>i</code> a finite number of times, <code>i</code> is identical to <code>j</code>;
|
||||
<li>the notation <code>[i,j)</code> refers to a <em>range</em> of iterators beginning with <code>i</code> and up to but not including <code>j</code>;
|
||||
<li>the range <code>[i,j)</code> is a <em>valid range</em> if both <code>i</code> and <code>j</code> are valid iterators, and <code>j</code> is reachable from <code>i</code>.
|
||||
</ul>
|
||||
@@ -41,4 +41,4 @@ In addition to the expressions defined in <a href="./Trivial_Iterator.html">Triv
|
||||
<p>
|
||||
<a href="./Sequence.html">Sequence</a>, <a href="./Trivial_Iterator.html">Trivial Iterator</a>, <a href="./Forward_Iterator.html">Forward Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 10:48 am</body></html>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited April 21, 2003 4:14 pm</body></html>
|
24
doc/ref/Macros.html
Normal file
24
doc/ref/Macros.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Macros</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Macros</h1><h4>Introspection</h4>
|
||||
<ul>
|
||||
<li>BOOST_MPL_HAS_XXX
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Configuration</h4>
|
||||
<ul>
|
||||
<li>BOOST_MPL_NO_PREPROCESSED_HEADERS
|
||||
<li>BOOST_MPL_METAFUNCTION_MAX_ARITY
|
||||
<li>BOOST_MPL_LIMIT_LIST_SIZE
|
||||
<li>BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
<li>BOOST_MPL_UNROLLING_LIMIT
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Broken compilers workarounds </h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/BOOST_MPL_AUX_LAMBDA_SUPPORT.html">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited November 12, 2003 1:35 am</body></html>
|
37
doc/ref/Rational_Constant.html
Normal file
37
doc/ref/Rational_Constant.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Rational Constant</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Rational Constant</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Rational Constant is a class representing the ration of two values of a built-in integral type (<code>bool</code>, <code>int</code>, <code>long</code>, etc.) in compile-time programs. A rational constant directly supports access to the numerator
|
||||
and denominator. Other arithmetic operations are supported through the external metafunctions. A rational constant is always stored in simplified form.
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Return type </th></tr>
|
||||
<tr><td><code>typename n::integer_type</code></td><td>An <em>integral type</em> </td></tr>
|
||||
<tr><td><code>typename n::type</code></td><td>A model of <a href="./Rational_Constant.html">Rational Constant</a> </td></tr>
|
||||
<tr><td><code>typename n::numerator</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> representing the numerator </td></tr>
|
||||
<tr><td><code>typename n::denominator</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> representing the denominator </td></tr>
|
||||
<tr><td><code>n::value()</code></td><td>A run-time floating point approximation of <code>n::type</code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Complexity </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/rational_c.html">rational_c</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Integral_Constant.html">Integral Constant</a>, <code><a href="./Reference/rational_c.html">rational_c</a></code>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited October 30, 2003 2:43 am</body></html>
|
50
doc/ref/Reference/BOOST_MPL_AUX_LAMBDA_SUPPORT.html
Normal file
50
doc/ref/Reference/BOOST_MPL_AUX_LAMBDA_SUPPORT.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::BOOST_MPL_AUX_LAMBDA_SUPPORT</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>BOOST_MPL_AUX_LAMBDA_SUPPORT</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#define BOOST_MPL_AUX_LAMBDA_SUPPORT(arity, fun, params) \
|
||||
<em>unspecified token sequence</em> \
|
||||
/**/
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Broken compiler workaround macro, enables metafunction <code>fun</code> for the use in lambda expressions on compilers that don't support partial template specialization or/and template template parameters. Expands to nothing on conforming compilers.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/aux_/lambda_support.hpp">boost/mpl/aux_/lambda_support.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Description </th></tr>
|
||||
<tr><td><code>arity</code></td><td>The metafunction's arity, i.e. the number of its template parameters, including the defaults. </td></tr>
|
||||
<tr><td><code>fun</code></td><td>The metafunction's name. </td></tr>
|
||||
<tr><td><code>params</code></td><td><a href="http://www.boost.org/libs/preprocessor/doc/index.html">PP</a>-tuple of the metafunction's parameter names, in their original order. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template< typename T, typename U = int > struct f
|
||||
{
|
||||
typedef T type[sizeof(U)];
|
||||
<p>
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,f,(T,U))
|
||||
};
|
||||
<p>
|
||||
typedef lambda< f<char,_1> >::type f_; <span class="cxx-comment">// use f in a lambda expression</span>
|
||||
typedef apply1<f_,long>::type res;
|
||||
BOOST_MPL_ASSERT_IS_SAME(res, char[sizeof(long)]);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Macros.html">Macros</a>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited November 12, 2003 1:29 am</body></html>
|
@@ -38,7 +38,7 @@ Returns the result of short-circuit <em>logical and</em> (<code>&&</code
|
||||
<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 and_<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>false_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to <code>false</code>, and <code>true_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to <code>false</code> are not evaluated.</td><td></td></tr>
|
||||
<tr><td><code>and_<f1,f2,..,fn></code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td><code>false_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to <code>false</code>, and <code>true_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to <code>false</code> are not evaluated.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
@@ -50,13 +50,13 @@ template< typename T > struct fail
|
||||
typedef typename T::nonexistent type;
|
||||
};
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((and_< true_,false_ >::type::value == false));
|
||||
BOOST_STATIC_ASSERT((and_< false_,fail<int> >::type::value == false)); <span class="cxx-comment">// OK, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((and_< true_,false_,fail<int> >::type::value == false)); <span class="cxx-comment">// OK too</span>
|
||||
BOOST_STATIC_ASSERT((and_< true_,false_ >::value == false));
|
||||
BOOST_STATIC_ASSERT((and_< false_,fail<int> >::value == false)); <span class="cxx-comment">// OK, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((and_< true_,false_,fail<int> >::value == false)); <span class="cxx-comment">// OK too</span>
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/or.html">or_</a></code>, <code><a href="../Reference/not.html">not_</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:21 am</body></html>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited September 6, 2003 3:13 am</body></html>
|
@@ -51,8 +51,8 @@ Linear. Exactly <code><a href="../Reference/size.html">size</a><Sequence>:
|
||||
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
|
||||
, <a href="../Reference/push_back.html">push_back</a><_,_>
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/size.html">size</a><result>::value == 20);
|
||||
@@ -67,4 +67,4 @@ BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a>< result,<a h
|
||||
<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_Contents.html">Table of Contents</a><br>Last edited July 19, 2002 2:10 am</body></html>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited May 20, 2003 1:36 am</body></html>
|
59
doc/ref/Reference/is_sequence.html
Normal file
59
doc/ref/Reference/is_sequence.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::is_sequence</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>is_sequence</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T
|
||||
>
|
||||
struct is_sequence
|
||||
{
|
||||
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 <code>T</code> is a model of <a href="../Sequence.html">Sequence</a>.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/is_sequence.hpp">boost/mpl/is_sequence.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 type</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 is_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/not.html">not_</a>< is_same< <a href="../Reference/begin.html">begin</a><T>::type,void_ > >::type c;</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
struct UDT {};
|
||||
BOOST_STATIC_ASSERT( !is_sequence<int>::value );
|
||||
BOOST_STATIC_ASSERT( !is_sequence<UDT>::value );
|
||||
BOOST_STATIC_ASSERT( is_sequence< <a href="../Reference/list.html">list</a><> >::value );
|
||||
BOOST_STATIC_ASSERT( is_sequence< <a href="../Reference/vector.html">vector</a><> >::value );
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<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>as_sequence</code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited July 1, 2003 4:08 pm</body></html>
|
@@ -34,18 +34,18 @@ Returns the result of <em>logical not</em> (<code>!</code>) operation on its arg
|
||||
<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_<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_<(!f::type::value)> c;</code></td><td></td></tr>
|
||||
<tr><td><code>not_<f></code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td>Equivalent to <code>bool_<(!f::type::value)></code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
BOOST_STATIC_ASSERT(not_<true_>::type::value == false);
|
||||
BOOST_STATIC_ASSERT(not_<false_>::type::value == true);
|
||||
BOOST_STATIC_ASSERT(not_<true_>::value == false);
|
||||
BOOST_STATIC_ASSERT(not_<false_>::value == true);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/and.html">and_</a></code>, <code><a href="../Reference/or.html">or_</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:19 am</body></html>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited September 6, 2003 3:09 am</body></html>
|
@@ -38,7 +38,7 @@ Returns the result of short-circuit <em>logical or</em> (<code>||</code>) operat
|
||||
<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 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_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to true, and <code>false_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to true are not evaluated.</td><td></td></tr>
|
||||
<tr><td><code>or_<f1,f2,..,fn></code></td><td>A model of <code>bool</code> <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td><code>true_</code> if either of <code>f1::type::value, f2::type::value, .., fn::type::value</code> expressions evaluates to true, and <code>false_</code> otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first <code>fi</code> metafunction that evaluates to true are not evaluated.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
@@ -50,13 +50,13 @@ template< typename T > struct fail
|
||||
typedef typename T::nonexistent type;
|
||||
};
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((or_< false_,true_ >::type::value == true));
|
||||
BOOST_STATIC_ASSERT((or_< true_,fail<int> >::type::value == true)); <span class="cxx-comment">// OK, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((or_< false_,true_,fail<int> >::type::value == true)); <span class="cxx-comment">// OK too</span>
|
||||
BOOST_STATIC_ASSERT((or_< false_,true_ >::value == true));
|
||||
BOOST_STATIC_ASSERT((or_< true_,fail<int> >::value == true)); <span class="cxx-comment">// OK, fail<int> is never invoked</span>
|
||||
BOOST_STATIC_ASSERT((or_< false_,true_,fail<int> >::value == true)); <span class="cxx-comment">// OK too</span>
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/and.html">and_</a></code>, <code><a href="../Reference/not.html">not_</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:18 am</body></html>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited September 6, 2003 3:14 am</body></html>
|
72
doc/ref/Reference/rational_c.html
Normal file
72
doc/ref/Reference/rational_c.html
Normal file
@@ -0,0 +1,72 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::rational_c</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>rational_c</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename IntegerType
|
||||
, IntegerType N
|
||||
, IntegerType D = 1
|
||||
>
|
||||
struct rational_c
|
||||
{
|
||||
typedef rational_c<IntegerType, N, D> type;
|
||||
typedef IntegerType integer_type;
|
||||
typedef integral_c<IntegerType,N> numerator;
|
||||
typedef integral_c<IntegerType,D> denominator;
|
||||
<p>
|
||||
static double value();
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
A model of <a href="../Rational_Constant.html">Rational Constant</a>.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/rational_c.hpp">boost/mpl/rational_c.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
||||
<tr><td><code>IntegerType</code></td><td>An integral type</td><td>Type used to represent numerator and denominator. </td></tr>
|
||||
<tr><td><code>N</code></td><td>A compile time integral constant of type <code>IntegerType</code></td><td>Value of numerator. </td></tr>
|
||||
<tr><td><code>D</code></td><td>A compile time integral constant of type <code>IntegerType</code></td><td>Value of denominator. </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>rational_c<T,n,d>::value()</code></td><td><code>double</code></td><td><code>static_cast<T>(d) != 0</code></td><td>Returns <code>static_cast<double>(static_cast<T>(n)) / static_cast<T>(d)</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
All operations take amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/rational_c.html">rational_c</a><int,1,2> half;
|
||||
typedef <a href="../Reference/rational_c.html">rational_c</a><int,2,4> half_2;
|
||||
typedef <a href="../Reference/rational_c.html">rational_c</a><long,9,15> three_fiths_3;
|
||||
typedef rational_plus<three_fiths,half>::type eleven_tenth;
|
||||
typedef rational_plus<half,half>::type one;
|
||||
typedef <a href="../Reference/rational_c.html">rational_c</a><long,1,8> eighth;
|
||||
typedef rational_minus<half,eighth>::type three_eighths;
|
||||
typedef rational_multiplies<half,eighth>::type sixteenth;
|
||||
typedef rational_divides<eighth,half>::type quarter;
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Rational_Constant.html">Rational Constant</a>, <a href="../Integral_Constant.html">Integral Constant</a>, <code>integral_c</code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited October 30, 2003 2:44 am</body></html>
|
@@ -11,6 +11,11 @@
|
||||
<li><a href="./Extensible_Sequence.html">Extensible Sequence</a>
|
||||
</ul>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href="./Associative_Sequence.html">Associative Sequence</a>
|
||||
<li><a href="./Extensible_Associative_Sequence.html">Extensible Associative Sequence</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Classes</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/vector.html">vector</a>
|
||||
@@ -20,6 +25,12 @@
|
||||
<li><a href="./Reference/range_c.html">range_c</a>
|
||||
</ul>
|
||||
<p>
|
||||
<ul>
|
||||
<li>set
|
||||
<li>map
|
||||
<li>set_c
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Views</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/transform_view.html">transform_view</a>
|
||||
@@ -30,10 +41,10 @@
|
||||
<li>as_sequence
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Metafunctions</h4>
|
||||
<h4>Intrinsic Metafunctions</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/begin.html">begin</a>/<a href="./Reference/end.html">end</a>
|
||||
<li>is_sequence
|
||||
<li><a href="./Reference/is_sequence.html">is_sequence</a>
|
||||
<li><a href="./Reference/size.html">size</a>
|
||||
<li><a href="./Reference/empty.html">empty</a>
|
||||
<li><a href="./Reference/front.html">front</a>
|
||||
@@ -50,4 +61,4 @@
|
||||
</ul>
|
||||
<p>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:07 am</body></html>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 1, 2003 3:47 pm</body></html>
|
@@ -8,8 +8,9 @@
|
||||
<li><a href="./Algorithms.html">Algorithms</a>
|
||||
<li><a href="./Metafunctions.html">Metafunctions</a>
|
||||
<li><a href="./Integral_constant_classes.html">Integral constant classes</a>
|
||||
<li><a href="./Macros.html">Macros</a>
|
||||
<li><a href="./Categorized_index.html">Categorized index</a>
|
||||
<li><a href="./Acknowledgements.html">Acknowledgements</a>
|
||||
</ol>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:32 am</body></html>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited November 6, 2003 11:39 am</body></html>
|
Reference in New Issue
Block a user