mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 14:54:30 +02:00
fix BoostBook/broken links/invalid filenames/etc.
[SVN r25931]
This commit is contained in:
484
doc/index.html
484
doc/index.html
@@ -1,495 +1,29 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>THE BOOST MPL LIBRARY</title>
|
||||
<link rel="stylesheet" href="article.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.50.0">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>THE BOOST MPL LIBRARY</title>
|
||||
<link rel="stylesheet" href="article.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.50.0">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
|
||||
<div class="article">
|
||||
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<img src="../../../boost.png" align="middle" width="277" height="86">
|
||||
<div class="articletitle">
|
||||
<h1 class="title"><a name="idafawr"></a>THE BOOST MPL LIBRARY</h1>
|
||||
<h1 class="title"><a name="idafawr"></a>THE BOOST MPL LIBRARY</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toc">
|
||||
<p><b>Table of Contents</b></p>
|
||||
<p>The Boost MPL library documentation is currently undergoing a major overhaul
|
||||
for the 1.32 release. Please come back in a few days.</p>
|
||||
|
||||
<dl>
|
||||
<dt>1. <a href="#preface">Preface</a></dt>
|
||||
|
||||
<dt>2. <a href="#source">Sources</a></dt>
|
||||
|
||||
<dt>3. <a href="#tutorial">Mini-tutorial</a></dt>
|
||||
|
||||
<dd>
|
||||
<dl>
|
||||
<dt>3.1. <a href="#tutorial.conventions">Conventions used</a></dt>
|
||||
|
||||
<dt>3.2. <a href="#metafunctions">Metafunctions</a></dt>
|
||||
|
||||
<dt>3.3. <a href="#if">Compile-time if</a></dt>
|
||||
|
||||
<dt>3.4. <a href="#applyif">apply_if</a></dt>
|
||||
|
||||
<dt>3.5. <a href="#applyif2">apply_if, part 2</a></dt>
|
||||
</dl>
|
||||
</dd>
|
||||
|
||||
<dt>4. <a href="#technical">Technical details</a></dt>
|
||||
|
||||
<dd>
|
||||
<dl>
|
||||
<dt>4.1. <a href="#details.headers">Physical structure</a></dt>
|
||||
|
||||
<dt>4.2. <a href="#details.depend">Dependencies</a></dt>
|
||||
|
||||
<dt>4.3. <a href="#details.portability">Portability</a></dt>
|
||||
</dl>
|
||||
</dd>
|
||||
|
||||
<dt>5. <a href="#acknw">Acknowledgements</a></dt>
|
||||
|
||||
<dt><a href="#bibliography">Bibliography</a></dt>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h2 class="title" style="clear: both"><a name="preface"></a>1. Preface</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The MPL library is a C++ template metaprogramming framework of compile-time algorithms, sequences and metafunction classes. The two main documentation sources for the library is “the MPL paper”, and the library's reference documentation. If you haven't heard about the MPL before, we suggest you to start with the paper, and then move on to the reference documentation and the information in this document.</p>
|
||||
|
||||
<div class="itemizedlist">
|
||||
<ul type="box">
|
||||
<li style="list-style-type: square">A. Gurtovoy, D. Abrahams, <a href="./paper/html/index.html" target="_top">The Boost C++ Metaprogramming Library</a>, March 2002 | [<a href="./paper/mpl_paper.pdf" target="_top">as .pdf</a>] [<a href="./paper/mpl_paper.html" target="_top">as single .html</a>]</li>
|
||||
|
||||
<li style="list-style-type: square"><a href="./ref/Table_of_Contents.html" target="_top">Reference documentation</a>
|
||||
<div class="orderedlist">
|
||||
<ol type="1">
|
||||
<li><a href="./ref/Sequences.html" target="_top">Sequences</a></li>
|
||||
|
||||
<li><a href="./ref/Iterators.html" target="_top">Iterators</a></li>
|
||||
|
||||
<li><a href="./ref/Algorithms.html" target="_top">Algorithms</a></li>
|
||||
|
||||
<li><a href="./ref/Metafunctions.html" target="_top">Metafunctions</a></li>
|
||||
|
||||
<li><a href="./ref/Integral_constant_classes.html" target="_top">Integral constant classes</a></li>
|
||||
|
||||
<li><a href="./ref/Categorized_index.html" target="_top">Categorized index</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h2 class="title" style="clear: both"><a name="source"></a>2. Sources</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The latest library sources are available from the main trunk of the <a href="http://www.boost.org/more/download.html#CVS" target="_top">Boost CVS</a>. <a href="http://boost.sourceforge.net/release/">Boost 1.30.0 distribution</a> contains a stable version of the library as per March 12, 2003.</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h2 class="title" style="clear: both"><a name="tutorial"></a>3. Mini-tutorial</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="tutorial.conventions"></a>3.1. Conventions used</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The examples used through this tutorial use fully qualified names, e.g. <tt>std::vector</tt> instead of plain <tt>vector</tt>. Any unqualified name refers to a local entity defined in the example itself. The names from <tt>boost::mpl</tt> namespace are referred to using <tt>mpl</tt> namespace alias (e.g. <tt>mpl::apply</tt> instead of <tt>boost::mpl::apply</tt>), as if the following namespace alias definition were in effect:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
namespace mpl = boost::mpl;
|
||||
</pre>
|
||||
|
||||
<p>Note that the library offers a special header, <tt>boost/mpl/alias.hpp</tt>, including which gives you a rough equivalent of the above. Alternatively, you can always spell the namespace alias definition manually in each translation unit as needed (if you choose to use the shorter namespace notation at all).</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="metafunctions"></a>3.2. Metafunctions</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>In MPL, the metaprogramming equivalent of a function is a <i>class template</i> containing a nested <tt>typedef</tt> member aptly named “type”:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
// on the face of it, not very useful
|
||||
template< typename T >
|
||||
struct identity
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// perhaps more useful
|
||||
template< typename T >
|
||||
struct result_type
|
||||
{
|
||||
typedef typename T::result_type type;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>“Invoking” a metafunction is as simple as instantiating the class template with particular template parameters (metafunction “arguments”) and accessing the result through the nested <tt>type</tt> member:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
typedef identity<int>::type t1; // t1 == int
|
||||
typedef result_type< std::unary_function<int,bool> >::type t2; // t2 == bool
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="if"></a>3.3. Compile-time if</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The most interesting template metaprograms often contain a lot of decision-making code. Some of conditional decisions/behavior can be handled directly by (partial) class template specialization or function overloading <span class="citation">[<a class="interlink" href="#ref.vel95a" title="[vel95a]">Vel95a</a>]</span>, <span class="citation">[<a class="interlink" href="#ref.ale00" title="[ale00]">Ale00</a>]</span>, but in general there is a need for a standalone library primitive that would allow one to choose between two types basing on a compile-time expression. In <tt>boost::mpl</tt> such primitive is called <tt>if_</tt>:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template< typename T >
|
||||
struct heap_holder
|
||||
{
|
||||
// ...
|
||||
private:
|
||||
boost::scoped_ptr<T> m_object;
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
struct stack_holder
|
||||
{
|
||||
// ...
|
||||
private:
|
||||
T m_object;
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
struct can_be_on_stack
|
||||
: mpl::bool_c< (sizeof(T) <= sizeof(double)) >
|
||||
{
|
||||
};
|
||||
|
||||
// use 'if_' to choose where to store 'T' member
|
||||
template< typename T >
|
||||
struct lightweight
|
||||
: private mpl::if_<
|
||||
can_be_on_stack<T>
|
||||
, stack_holder<T>
|
||||
, heap_holder<T>
|
||||
>::type
|
||||
{
|
||||
// ...
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>Note that the first template parameter of the <tt>if_</tt> template is a type that should be a model of Integral Constant concept. The library also provides a less generic but sometimes more convenient form that accepts a condition in form of non-type <tt>bool</tt> template parameter:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template< typename T >
|
||||
struct lightweight
|
||||
: private mpl::if_c<
|
||||
(sizeof(T) <= sizeof(double))
|
||||
, stack_holder<T>
|
||||
, heap_holder<T>
|
||||
>::type
|
||||
{
|
||||
// ...
|
||||
};
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="applyif"></a>3.4. apply_if</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>In run-time C++, it is guaranteed that when we reach an <tt>if</tt> statement, only one branch will be executed. Executing the branch for which the result is not required would be unnecessary and inefficient. More importantly, frequently the non-required branch is invalid, and executing it would cause an error. For instance, the following code would be badly broken if both branches of the statement were evaluated:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
void fun(giraffe* g)
|
||||
{
|
||||
if (g)
|
||||
cout << g->name();
|
||||
else
|
||||
cout << "no giraffe";
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>In compile-time world, things are different. Which parameters to <tt>if_</tt> template are instantiated is determined by the form of each template parameter and the corresponding language rules (<span class="citation">[<a class="interlink" href="#ref.iso98" title="[iso98]">ISO98</a>]</span>, section 14.7.1), not by the value of the compile-time expression being switched on. That means that if, in attempt to process a particular <tt>if_</tt> construct, the compiler determines that one of its “branch” template parameters is ill-formed, it will issue a diagnostics even if the value of compile-time expression would lead to “choosing” the other, valid parameter type.</p>
|
||||
|
||||
<p>To clarify what we just said, here is a broken first attempt at writing a <tt>pointed_type</tt> metafunction, that when instantiated for a <tt>T</tt> that is either a plain pointer or a smart pointer, “returns” the pointed type:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template< typename T >
|
||||
struct pointed_type
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
boost::is_pointer<T>
|
||||
, typename boost::remove_pointer<T>::type
|
||||
, typename T::element_type // #1
|
||||
>::type type;
|
||||
};
|
||||
|
||||
typedef pointed_type< std::auto_ptr<int> >::type int_ptr; // ok
|
||||
typedef pointed_type<char*>::type char_ptr; // error in line #1!
|
||||
</pre>
|
||||
|
||||
<p>If we try to compile the above, we will get something like this:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
Error: name followed by "::" must be a class or namespace name
|
||||
</pre>
|
||||
|
||||
<p>because the expression <tt>typename T::element_type</tt> is not valid in case of <tt>T == char*</tt>.</p>
|
||||
|
||||
<p>Here's what we need to do to make <tt>pointed_type</tt> work for plain pointers: <sup><a name="idakqwr" href="#ftn.IDAKQWR">1</a></sup> instead of instantiating our two potential results before passing them to <tt>if_</tt>, we need to write metafunctions that can be used to instantiate the results; then we can use <tt>if_</tt> to choose a metafunction, and only then should we use that function to get the result.</p>
|
||||
|
||||
<p><tt>boost::remove_pointer</tt> already is a metafunction. We just need to write an auxiliary function to return the <tt>element_type</tt> of a pointer type:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
namespace aux {
|
||||
template< typename T >
|
||||
struct element_type
|
||||
{
|
||||
typedef typename T::element_type type;
|
||||
};
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Now we can select the metafunction to call based on the result of <tt>boost::is_pointer</tt>, and then <span class="emphasis"><em>apply</em></span> it to form the result:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template< typename T >
|
||||
struct pointed_type
|
||||
{
|
||||
private:
|
||||
// pick a metafunction
|
||||
typedef typename mpl::if_<
|
||||
boost::is_pointer<T>
|
||||
, boost::remove_pointer<T>
|
||||
, aux::element_type<T>
|
||||
>::type func_; // #1
|
||||
|
||||
public:
|
||||
// apply the metafunction
|
||||
typedef typename func_::type type;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>The key knowledge that makes the above viable is that in line #1 the compiler is <span class="emphasis"><em>guaranteed</em></span> not to instantiate <tt>boost::remove_pointer<T></tt> and <tt>aux::element_type<T></tt> templates, - even although they are passed as actual arguments to the <tt>if_</tt>.</p>
|
||||
|
||||
<p>The described technique is so common in template metaprograms, that it makes sense to facilitate the selection of the nested <tt>type</tt> member by introducing a high level equivalent to <tt>if_</tt> that will do <tt>func_::type</tt> operation as a part of its invocation. The MPL provides such a template - it's called <tt>apply_if</tt>. Using it, we can re-write the above code as simply as:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
[
|
||||
template< typename T >
|
||||
struct pointed_type
|
||||
{
|
||||
typedef typename mpl::apply_if<
|
||||
boost::is_pointer<T>
|
||||
, boost::remove_pointer<T>
|
||||
, aux::element_type<T>
|
||||
>::type type;
|
||||
};
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="applyif2"></a>3.5. apply_if, part 2</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Besides solving the “making the code compile” problem, the <tt>apply_if</tt> technique we've just learned can be also used to improve metaprogram efficiency.</p>
|
||||
|
||||
<p>Suppose we want to define a high-level wrapper around <tt>boost::remove_pointer</tt> traits template, which will strip the pointer qualification conditionally. We will call it <tt>remove_pointer_if</tt>:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template<
|
||||
typename Condition
|
||||
, typename T
|
||||
>
|
||||
struct remove_pointer_if
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
Condition
|
||||
, typename boost::remove_pointer<T>::type
|
||||
, T
|
||||
>::type type;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>The above works the first time, but it's not the most optimal implementation. Similar to our previous examples, <tt>boost::remove_pointer<T></tt> gets instantiated even if its result is never used. In the metaprogramming world compilation time is an important resource <span class="citation">[<a class="interlink" href="#ref.abr01" title="[abr01]">Abr01</a>]</span>, and it is wasted by unnecessary template instantiations.</p>
|
||||
|
||||
<p>Let's see what we need to substitute <tt>if_</tt> by <tt>apply_if</tt> here. We already have one metafunction to pass to <tt>apply_if</tt> - <tt>boost::remove_pointer<T></tt>, but we need a second one, - let's call it <tt>f</tt>, - such as <tt>f<T>::type == T</tt>. We could write this one ourselves, but fortunately MPL already provides us with a template that matches this exact definition - it's called <tt>identity</tt>. Applying this knowledge, we get:</p>
|
||||
|
||||
<pre class="programlisting">
|
||||
template<
|
||||
typename Condition
|
||||
, typename T
|
||||
>
|
||||
struct remove_pointer_if
|
||||
{
|
||||
typedef typename mpl::apply_if<
|
||||
Condition
|
||||
, boost::remove_pointer<T>
|
||||
, mpl::identity<T>
|
||||
>::type type;
|
||||
};
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h2 class="title" style="clear: both"><a name="technical"></a>4. Technical details</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="details.headers"></a>4.1. Physical structure</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>The library provides you with a fine-grained header structure with one header per public component (class/function template), with the header named after the component; for example, <tt>boost::mpl::apply<></tt> template is defined in the header <tt>boost/mpl/apply.hpp</tt>. This scheme both ensures that you don't pay for what you don't use in terms of compilation time/header dependencies, and frees you from memorizing/looking up header/component correspondence. Several composite headers for the entities that are likely to be used together (e.g. logical operations - <tt>logical_or</tt>, <tt>logical_and</tt>, etc.) are also provided. It allows one to avoid the burden of spelling many <tt>#include</tt> directives in programs that make an intensive use of the library facilities. <sup><a name="note.headers" href="#ftn.note.headers">2</a></sup></p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="details.depend"></a>4.2. Dependencies</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Besides <tt>boost/config.hpp</tt> header, the MPL heavily depends on two other Boost libraries - the Boost Preprocessor library <span class="citation">[<a class="interlink" href="#ref.pre" title="[pre]">PRE</a>]</span>, and the Type Traits library <span class="citation">[<a class="interlink" href="#ref.ttl" title="[ttl]">TTL</a>]</span>. These dependencies are essential and cannot be eliminated. In addition to those, the <tt>boost/mpl/assert.hpp</tt> header depends on Boost Static Assert library <span class="citation">[<a class="interlink" href="#ref.sal" title="[sal]">SAL</a>]</span>. The library tests and examples may depend on some additional Boost libraries, e.g. Boost Bind <span class="citation">[<a class="interlink" href="#ref.bbl" title="[bbl]">BBL</a>]</span>; you don't have to have those unless you are interested in actually compiling the tests/examples (probably you are, though).</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h3 class="title"><a name="details.portability"></a>4.3. Portability</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Below is the list of compilers the library has been tested with:</p>
|
||||
|
||||
<div class="itemizedlist">
|
||||
<ul type="box">
|
||||
<li style="list-style-type: square">Microsoft Visual C++ 6.0, SP 5</li>
|
||||
|
||||
<li style="list-style-type: square">Microsoft Visual C++ .NET (7.0)</li>
|
||||
|
||||
<li style="list-style-type: square">Metrowerks CodeWariror 7.2/8.1</li>
|
||||
|
||||
<li style="list-style-type: square">Intel C++ Compiler 5.0, 6.0</li>
|
||||
|
||||
<li style="list-style-type: square">GCC 2.95.3-5</li>
|
||||
|
||||
<li style="list-style-type: square">GCC 3.1</li>
|
||||
|
||||
<li style="list-style-type: square">Comeau C/C++ 4.2.45/4.3.0</li>
|
||||
|
||||
<li style="list-style-type: square">Borland C++ 5.5.1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p>An incomplete matrix of recent test compilation results is available from here - <a href="http://www.mywikinet.com/mpl/log.html" target="_top">http://www.mywikinet.com/mpl/log.html</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h2 class="title" style="clear: both"><a name="acknw"></a>5. Acknowledgements</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Following is a list of people who in one or another way contributed to the library development. The list is work in progress!</p>
|
||||
|
||||
<p>David Abrahams, Emily Winch, Eric Friedman, Vesa Karvonen, Peter Dimov, Mat Marcus, Fernando Cacciola, Paul Mensonides, David B. Held, John Bandela, Arnaldur Gylfason, Hamish Mackenzie.</p>
|
||||
|
||||
<p><b>Copyright on this document. </b>Copyright © 2002 Aleksey Gurtovoy, David Abrahams and Emily Winch.</p>
|
||||
</div>
|
||||
|
||||
<div class="bibliography">
|
||||
<div class="titlepage">
|
||||
<div>
|
||||
<h1 class="title"><a name="bibliography"></a>Bibliography</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.abr01"></a>
|
||||
<p>[Abr01] <span class="authorgroup">David Abrahams and Carlos Pinto Coelho,</span> <span class="title"><i><a href="http://users.rcn.com/abrahams/instantiation_speed/index.html" target="_top">Effects of Metaprogramming Style on Compilation Time</a></i>,</span> <span class="date">2001</span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.ale00"></a>
|
||||
<p>[Ale00] <span class="author">Andrei Alexandrescu,</span> <span class="title"><i><a href="http://www.cuj.com/experts/1810/alexandr.htm" target="_top">On Conversions between Types and Values</a></i>,</span> <span class="publishername">C/C++ Users Journal,</span> <span class="date">October 2000</span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.bbl"></a>
|
||||
<p>[BBL] <span class="title"><i>Boost Bind library</i>,</span> <span class="bibliomisc"><a href="http://www.boost.org/libs/bind/bind.html" target="_top">http://www.boost.org/libs/bind/bind.html</a></span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.iso98"></a>
|
||||
<p>[ISO98] <span class="title"><i>ISO/IEC 14882:1998(E), Programming languages — C++</i>,</span> <span class="orgname">ISO/IEC,</span> <span class="date">1998</span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.pre"></a>
|
||||
<p>[PRE] <span class="author">Vesa Karvonen,</span> <span class="title"><i>Boost Preprocessor Metaprogramming library</i>,</span> <span class="bibliomisc"><a href="http://www.boost.org/libs/preprocessor/doc/" target="_top">http://www.boost.org/libs/preprocessor/doc/</a></span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.ttl"></a>
|
||||
<p>[TTL] <span class="title"><i>Boost Type Traits library</i>,</span> <span class="bibliomisc"><a href="http://www.boost.org/libs/type_traits/" target="_top">http://www.boost.org/libs/type_traits/</a></span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.sal"></a>
|
||||
<p>[SAL] <span class="title"><i>Boost Static Assert library</i>,</span> <span class="bibliomisc"><a href="http://www.boost.org/libs/static_assert/static_assert.htm" target="_top">http://www.boost.org/libs/static_assert/static_assert.htm</a></span></p>
|
||||
</div>
|
||||
|
||||
<div class="biblioentry"><a name="ref.vel95a"></a>
|
||||
<p>[Vel95a] <span class="author">Todd Veldhuizen,</span> <span class="title"><i><a href="http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html" target="_top">Using C++ template metaprograms</a></i>,</span> <span class="biblioset"><i>C++ Report</i>, <span class="publishername">SIGS Publications Inc.,</span> <span class="issn">ISSN 1040-6042,</span></span> <span class="volumenum">Vol. 7,</span> <span class="issuenum">No. 4,</span> <span class="pagenums">pp. 36-43,</span> <span class="date">May 1995</span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footnotes"><br>
|
||||
<hr width="100" align="left">
|
||||
<div class="footnote">
|
||||
<p><sup><a name="ftn.idakqwr" href="#IDAKQWR">1</a></sup> It would be easy to implement <tt>pointed_type</tt> using partial specialization to distinguish the case where <tt>T</tt> is a pointer. <tt>if_</tt> is used here to avoid creating a complicated example.</p>
|
||||
</div>
|
||||
|
||||
<div class="footnote">
|
||||
<p><sup><a name="ftn.note.headers" href="#note.headers">2</a></sup> The Boost Preprocessor library <span class="citation">[<a class="interlink" href="#ref.pre" title="[pre]">PRE</a>]</span> exposes a very similar physical organization; in fact, the libraries even share the common subdirectory naming (<tt>mpl/arithmetic</tt> <-> <tt>preprocessor/arithmetic</tt>, <tt>mpl/comparison</tt> <-> <tt>preprocessor/comparison</tt>, etc.).</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@@ -1,7 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<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>.
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 9:04 am</body></html>
|
@@ -1,40 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Algorithms</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>Algorithms</h1><h4>Iteration algorithms</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/iter_fold.html">iter_fold</a>
|
||||
<li><a href="./Reference/iter_fold_backward.html">iter_fold_backward</a>
|
||||
<li><a href="./Reference/fold.html">fold</a>
|
||||
<li><a href="./Reference/fold_backward.html">fold_backward</a>
|
||||
<li><a href="./Reference/copy.html">copy</a>
|
||||
<li><a href="./Reference/copy_if.html">copy_if</a>
|
||||
<li><a href="./Reference/copy_backward.html">copy_backward</a>
|
||||
<li><a href="./Reference/copy_backward_if.html">copy_backward_if</a>
|
||||
</ul>
|
||||
<h4>Querying algorithms</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/find.html">find</a>
|
||||
<li><a href="./Reference/find_if.html">find_if</a>
|
||||
<li><a href="./Reference/contains.html">contains</a>
|
||||
<li><a href="./Reference/count.html">count</a>
|
||||
<li><a href="./Reference/count_if.html">count_if</a>
|
||||
<li><a href="./Reference/equal.html">equal</a>
|
||||
<li><a href="./Reference/lower_bound.html">lower_bound</a>
|
||||
<li><a href="./Reference/upper_bound.html">upper_bound</a>
|
||||
<li><a href="./Reference/max_element.html">max_element</a>
|
||||
<li><a href="./Reference/min_element.html">min_element</a>
|
||||
</ul>
|
||||
<h4>Transformation algorithms</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/transform.html">transform</a>
|
||||
<li><a href="./Reference/remove.html">remove</a>
|
||||
<li><a href="./Reference/remove_if.html">remove_if</a>
|
||||
<li><a href="./Reference/replace.html">replace</a>
|
||||
<li><a href="./Reference/replace_if.html">replace_if</a>
|
||||
<li><a href="./Reference/reverse.html">reverse</a>
|
||||
<li>unique
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:55 am</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!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>
|
@@ -1,50 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Bidirectional Iterator</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>Bidirectional Iterator</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Bidirectional Iterator is a <a href="./Forward_Iterator.html">Forward Iterator</a> that provides a way to obtain the previous element in a sequence.
|
||||
<p>
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Forward_Iterator.html">Forward Iterator</a>
|
||||
<p>
|
||||
<h3>Definitions</h3>
|
||||
<ul>
|
||||
<li>a bidirectional iterator <code>i</code> is <em>decrementable</em> if there is a "previous" iterator, that is, if <code>i::prior</code> expression is well-defined; iterators pointing to the first element of the sequence are not decrementable.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Bidirectional Iterator both defines a new expression and refines the one described in <a href="./Forward_Iterator.html">Forward Iterator</a>.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename i::next</code></td><td>A model of <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> </td></tr>
|
||||
<tr><td><code>typename i::prior</code></td><td>A model of <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
Semantics of an expression is defined only where it is not defined in <a href="./Forward_Iterator.html">Forward Iterator</a>.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Complexity </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typename i::prior</code></td><td>Amortized constant time</td><td><code>i</code> is decrementable</td><td><code>i::prior</code> is an iterator pointing to the previous element of the sequence</td><td><code>i::prior</code> is dereferencable and incrementable </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any bidirectional iterators <code>i</code> and <code>j</code> the following invariants always hold:
|
||||
<p>
|
||||
<ul>
|
||||
<li>if <code>i</code> is incrementable, then <code>i::next::prior</code> is a null operation; similarly, if <code>i</code> is decrementable, <code>i::prior::next</code> is a null operation.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>, <a href="./Forward_Iterator.html">Forward Iterator</a>, <a href="./Random_Access_Iterator.html">Random Access Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 11:33 am</body></html>
|
@@ -1,35 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Bidirectional 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>Bidirectional Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Bidirectional Sequence is a <a href="./Forward_Sequence.html">Forward Sequence</a>, which provides iterators that satisfy the <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> requirements.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Forward_Sequence.html">Forward Sequence</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Bidirectional Sequence does not define any new expressions beyond those defined in <a href="./Forward_Sequence.html">Forward Sequence</a>. However, it refines the expression requirements.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename begin<s>::type</code></td><td>A model of <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> </td></tr>
|
||||
<tr><td><code>typename end<s>::type</code></td><td>A model of <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/vector.html">vector</a></code>
|
||||
<li><code><a href="./Reference/vector_c.html">vector_c</a></code>
|
||||
<li><code><a href="./Reference/range_c.html">range_c</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Random_Access_Sequence.html">Random Access Sequence</a>, <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 2:36 pm</body></html>
|
@@ -1,98 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Categorized index</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>Categorized index</h1><h4>Concepts</h4>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<li><a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>
|
||||
<li><a href="./Extensible_Sequence.html">Extensible Sequence</a>
|
||||
<li><a href="./Forward_Iterator.html">Forward Iterator</a>
|
||||
<li><a href="./Forward_Sequence.html">Forward Sequence</a>
|
||||
<li><a href="./Input_Iterator.html">Input Iterator</a>
|
||||
<li><a href="./Integral_Constant.html">Integral Constant</a>
|
||||
<li><a href="./Metafunction.html">Metafunction</a>
|
||||
<li><a href="./Metafunction_Class.html">Metafunction Class</a>
|
||||
<li><a href="./Random_Access_Iterator.html">Random Access Iterator</a>
|
||||
<li><a href="./Random_Access_Sequence.html">Random Access Sequence</a>
|
||||
<li><a href="./Sequence.html">Sequence</a>
|
||||
<li><a href="./Trivial_Iterator.html">Trivial Iterator</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Components</h4>
|
||||
<p>
|
||||
<ul>
|
||||
<li><a href="./Reference/advance.html">advance</a>
|
||||
<li><a href="./Reference/and.html">and_</a>
|
||||
<li><a href="./Reference/at.html">at</a>
|
||||
<li><a href="./Reference/at_c.html">at_c</a>
|
||||
<li><a href="./Reference/back.html">back</a>
|
||||
<li><a href="./Reference/begin.html">begin</a>
|
||||
<li><a href="./Reference/clear.html">clear</a>
|
||||
<li><a href="./Reference/contains.html">contains</a>
|
||||
<li><a href="./Reference/copy.html">copy</a>
|
||||
<li><a href="./Reference/copy_backward.html">copy_backward</a>
|
||||
<li><a href="./Reference/copy_backward_if.html">copy_backward_if</a>
|
||||
<li><a href="./Reference/copy_if.html">copy_if</a>
|
||||
<li><a href="./Reference/count.html">count</a>
|
||||
<li><a href="./Reference/count_if.html">count_if</a>
|
||||
<li><a href="./Reference/deref.html">deref</a>
|
||||
<li><a href="./Reference/distance.html">distance</a>
|
||||
<li><a href="./Reference/divides.html">divides</a>
|
||||
<li><a href="./Reference/empty.html">empty</a>
|
||||
<li><a href="./Reference/end.html">end</a>
|
||||
<li><a href="./Reference/equal.html">equal</a>
|
||||
<li><a href="./Reference/equal_to.html">equal_to</a>
|
||||
<li><a href="./Reference/erase.html">erase</a>
|
||||
<li><a href="./Reference/erase_range.html">erase_range</a>
|
||||
<li><a href="./Reference/filter_view.html">filter_view</a>
|
||||
<li><a href="./Reference/find.html">find</a>
|
||||
<li><a href="./Reference/find_if.html">find_if</a>
|
||||
<li><a href="./Reference/fold.html">fold</a>
|
||||
<li><a href="./Reference/fold_backward.html">fold_backward</a>
|
||||
<li><a href="./Reference/front.html">front</a>
|
||||
<li><a href="./Reference/greater.html">greater</a>
|
||||
<li><a href="./Reference/greater_equal.html">greater_equal</a>
|
||||
<li><a href="./Reference/insert.html">insert</a>
|
||||
<li><a href="./Reference/insert_range.html">insert_range</a>
|
||||
<li><a href="./Reference/iter_fold.html">iter_fold</a>
|
||||
<li><a href="./Reference/iter_fold_backward.html">iter_fold_backward</a>
|
||||
<li><a href="./Reference/iterator_category.html">iterator_category</a>
|
||||
<li><a href="./Reference/joint_view.html">joint_view</a>
|
||||
<li><a href="./Reference/less.html">less</a>
|
||||
<li><a href="./Reference/less_equal.html">less_equal</a>
|
||||
<li><a href="./Reference/list.html">list</a>
|
||||
<li><a href="./Reference/list_c.html">list_c</a>
|
||||
<li><a href="./Reference/lower_bound.html">lower_bound</a>
|
||||
<li><a href="./Reference/max_element.html">max_element</a>
|
||||
<li><a href="./Reference/min_element.html">min_element</a>
|
||||
<li><a href="./Reference/minus.html">minus</a>
|
||||
<li><a href="./Reference/modulus.html">modulus</a>
|
||||
<li><a href="./Reference/multiplies.html">multiplies</a>
|
||||
<li><a href="./Reference/negate.html">negate</a>
|
||||
<li><a href="./Reference/not.html">not_</a>
|
||||
<li><a href="./Reference/not_equal_to.html">not_equal_to</a>
|
||||
<li><a href="./Reference/or.html">or_</a>
|
||||
<li><a href="./Reference/plus.html">plus</a>
|
||||
<li><a href="./Reference/pop_back.html">pop_back</a>
|
||||
<li><a href="./Reference/pop_front.html">pop_front</a>
|
||||
<li><a href="./Reference/push_back.html">push_back</a>
|
||||
<li><a href="./Reference/push_front.html">push_front</a>
|
||||
<li><a href="./Reference/range_c.html">range_c</a>
|
||||
<li><a href="./Reference/remove.html">remove</a>
|
||||
<li><a href="./Reference/remove_if.html">remove_if</a>
|
||||
<li><a href="./Reference/replace.html">replace</a>
|
||||
<li><a href="./Reference/replace_if.html">replace_if</a>
|
||||
<li><a href="./Reference/reverse.html">reverse</a>
|
||||
<li><a href="./Reference/single_view.html">single_view</a>
|
||||
<li><a href="./Reference/size.html">size</a>
|
||||
<li><a href="./Reference/transform.html">transform</a>
|
||||
<li><a href="./Reference/transform_view.html">transform_view</a>
|
||||
<li><a href="./Reference/upper_bound.html">upper_bound</a>
|
||||
<li><a href="./Reference/vector.html">vector</a>
|
||||
<li><a href="./Reference/vector_c.html">vector_c</a>
|
||||
<li><a href="./Reference/zip_view.html">zip_view</a>
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 7:17 am</body></html>
|
@@ -1,47 +0,0 @@
|
||||
<!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>
|
@@ -1,40 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Extensible 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 Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
An Extensible Sequence is either a <a href="./Forward_Sequence.html">Forward Sequence</a>, a <a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a> or a <a href="./Random_Access_Sequence.html">Random Access Sequence</a> that supports insertion and removal operations.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a> or <a href="./Random_Access_Sequence.html">Random Access 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,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>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
See the description of <a href="./Reference/clear.html">clear</a>, <a href="./Reference/insert.html">insert</a>, and <a href="./Reference/erase.html">erase</a> algorithms.
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/vector.html">vector</a></code>
|
||||
<li><code><a href="./Reference/vector_c.html">vector_c</a></code>
|
||||
<li><code><a href="./Reference/list.html">list</a></code>
|
||||
<li><code><a href="./Reference/list_c.html">list_c</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<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 May 2, 2003 4:54 am</body></html>
|
@@ -1,34 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Forward Iterator</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>Forward Iterator</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Forward Iterator is an <a href="./Input_Iterator.html">Input Iterator</a> that guarantees a linear traversal over the sequence.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Input_Iterator.html">Input Iterator</a>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Forward Iterator does not define any new expressions beyond those defined in <a href="./Input_Iterator.html">Input Iterator</a>. However, some of the restrictions described in <a href="./Input_Iterator.html">Input Iterator</a> are relaxed.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename i::next</code></td><td>A model of <a href="./Forward_Iterator.html">Forward Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any forward iterators i and j the following invariants always hold:
|
||||
<ul>
|
||||
<li>if <code>i</code> and <code>j</code> are dereferenceable and <code>i</code> is identical to <code>j</code>, then <code>i::next</code> is identical to <code>j::next</code>.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Input_Iterator.html">Input Iterator</a>, <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 10:53 am</body></html>
|
@@ -1,48 +1,10 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Forward 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>Forward Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Forward Sequence is a <a href="./Sequence.html">Sequence</a> which guarantees that its elements are arranged in a definite order, and that the ordering will not change spontaneously [<a href="#1">1</a>]. Iterators into a forward sequence satisfy the <a href="./Forward_Iterator.html">Forward Iterator</a> requirements.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Sequence.html">Sequence</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Forward Sequence does not define any new expressions beyond those defined in <a href="./Sequence.html">Sequence</a>. However, it refines the expression requirements.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename begin<s>::type</code></td><td>A model of <a href="./Forward_Iterator.html">Forward Iterator</a> </td></tr>
|
||||
<tr><td><code>typename end<s>::type</code></td><td>A model of <a href="./Forward_Iterator.html">Forward Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any forward sequence <code>s</code> the following invariants always hold:
|
||||
<ul>
|
||||
<li>Two different iterations through <code>s</code> will access its elements in the same order.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/vector.html">vector</a></code>
|
||||
<li><code><a href="./Reference/vector_c.html">vector_c</a></code>
|
||||
<li><code><a href="./Reference/list.html">list</a></code>
|
||||
<li><code><a href="./Reference/list_c.html">list_c</a></code>
|
||||
<li><code><a href="./Reference/range_c.html">range_c</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
[<a name="1">1</a>] Both between compilation sessions and from iteration to iteration.<br>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Sequence.html">Sequence</a>, <a href="./Bidirectional_Sequence.html">Bidirectional Sequence</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 2:34 pm</body></html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=../index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../index.html">../index.html</a>.
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,44 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Input Iterator</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>Input Iterator</h1><h3>Description</h3>
|
||||
<p>
|
||||
An Input Iterator is a <a href="./Trivial_Iterator.html">Trivial Iterator</a> that provides a way to obtain the next iterator in a sequence.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Trivial_Iterator.html">Trivial Iterator</a>
|
||||
<p>
|
||||
<h3>Definitions</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<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 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>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
In addition to the expressions defined in <a href="./Trivial_Iterator.html">Trivial Iterator</a>, the following expressions must be valid.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename i::next</code></td><td>A model of <a href="./Input_Iterator.html">Input Iterator</a> </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>typename i::next</code></td><td>Amortized constant time</td><td><code>i</code> is incrementable</td><td><code>i::next</code> is the next iterator in a sequence</td><td><code>i::next</code> is dereferenceable or past-the-end </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<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 April 21, 2003 4:14 pm</body></html>
|
@@ -1,43 +1,10 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Integral 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>Integral Constant</h1><h3>Description</h3>
|
||||
<p>
|
||||
An Integral Constant is a class representing a value of a built-in integral type (<code>bool</code>, <code>int</code>, <code>long</code>, etc.) in compile-time programs. An integral constant directly supports the increment/decrement operations within the range of the built-in integral type it wraps. Other arithmetic operations are supported through the external metafunctions.
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Return type </th></tr>
|
||||
<tr><td><code>typename n::value_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="./Integral_Constant.html">Integral Constant</a> </td></tr>
|
||||
<tr><td><code>n::value</code></td><td>A compile-time integral constant of <code>n::value_type</code> </td></tr>
|
||||
<tr><td><code>typename n::next</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> </td></tr>
|
||||
<tr><td><code>typename n::prior</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> </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>typename n::value_type</code></td><td>Amortized constant time</td><td></td><td><code>n::value_type</code> is identical to <code>typeof(n::value)</code></td><td></td></tr>
|
||||
<tr><td><code>typename n::type</code></td><td>Amortized constant time</td><td></td><td>Self-reference.</td><td><code>is_same<n::type,n>::value == true</code> </td></tr>
|
||||
<tr><td><code>n::value</code></td><td>Amortized constant time</td><td></td><td>Value of <code>n</code>.</td><td></td></tr>
|
||||
<tr><td><code>typename n::next</code></td><td>Amortized constant time</td><td><code>n::value_type</code> supports an increment operation; <code>n::value</code> is incrementable</td><td>Increment operation</td><td><code>n::next::value == n::value + 1</code> </td></tr>
|
||||
<tr><td><code>typename n::prior</code></td><td>Amortized constant time</td><td><code>n::value_type</code> supports an decrement operation; <code>n::value</code> is decrementable</td><td>Decrement operation</td><td><code>n::prior::value == n::value - 1</code> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code>integral_c</code>
|
||||
<li><code>int_</code>
|
||||
<li><code>bool_</code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<code>next</code>, <code>prior</code>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 4:21 am</body></html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=../index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../index.html">../index.html</a>.
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,19 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Integral constant classes</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Integral constant classes</h1><h4>Concepts</h4>
|
||||
<ul>
|
||||
<li><a href="./Integral_Constant.html">Integral Constant</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Types</h4>
|
||||
<ul>
|
||||
<li>integral_c
|
||||
<li>bool_
|
||||
<li>int_
|
||||
<li>long_
|
||||
<li>size_t
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:34 am</body></html>
|
@@ -1,31 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Iterators</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>Iterators</h1>Iterators are a generic means of addressing a particular element or
|
||||
range of sequential elements in a sequence. They are also the mechanism
|
||||
that makes it possible to decouple algorithms from concrete compile-time
|
||||
sequence implementations. Under the hood, all MPL <a href="./Algorithms.html">sequence algorithms</a>
|
||||
are implemented in terms of iterators, which, in particular, means that
|
||||
they will work on any custom compile-time sequence, given that the appropriate
|
||||
iterator inteface is provided.
|
||||
<p>
|
||||
<h4>Concepts</h4>
|
||||
<ul>
|
||||
<li><a href="./Trivial_Iterator.html">Trivial Iterator</a>
|
||||
<li><a href="./Input_Iterator.html">Input Iterator</a>
|
||||
<li><a href="./Forward_Iterator.html">Forward Iterator</a>
|
||||
<li><a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<li><a href="./Random_Access_Iterator.html">Random Access Iterator</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Metafunctions</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/iterator_category.html">iterator_category</a>
|
||||
<li><a href="./Reference/begin.html">begin</a>/<a href="./Reference/end.html">end</a>
|
||||
<li><a href="./Reference/deref.html">deref</a>
|
||||
<li><a href="./Reference/advance.html">advance</a>
|
||||
<li><a href="./Reference/distance.html">distance</a>
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 1:42 am</body></html>
|
@@ -1,24 +0,0 @@
|
||||
<!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>
|
@@ -1,77 +1,10 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Metafunction</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Metafunction</h1><h3>Description</h3>
|
||||
<p>
|
||||
A <em>metafunction</em> is a class or a class template that represents a function invocable at compile-time. A non-nullary metafunction is invoked by instantiating the class template with particular template parameters
|
||||
(metafunction arguments); the result of the metafunction application is accessible through the instantiation's nested <code>type</code> typedef. All metafunction's arguments must be types (i.e. only <em>type template parameters</em> are allowed). A metafunction can have a variable number of parameters. A nullary metafunction is represented as a class with a nested
|
||||
<code>type</code> typename member.
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename f::type</code></td><td>A type </td></tr>
|
||||
<tr><td><code>typename f<a1,..,an>::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>typename f::type</code></td><td>unspecified</td><td><code>f</code> is a nullary metafunction; <code>f::type</code> is a <em>type-name</em></td><td><code>f::type</code> is the result of the metafunction invocation</td><td></td></tr>
|
||||
<tr><td><code>typename f<a1,..,an>::type</code></td><td>unspecified</td><td><code>f</code> is an <code>n</code>-ary metafunction; <code>a1,..,an</code> are types; <code>f<a1,..,an>::type</code> is a <em>type-name</em></td><td><code>f<a1,..,an>::type</code> is the result of the metafunction invocation with the actual arguments <code>a1,..,an</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
<span class="cxx-comment">// nullary metafunction</span>
|
||||
struct always_true { typedef true_ type; };
|
||||
<p>
|
||||
<span class="cxx-comment">// unary metafunction</span>
|
||||
template< typename T > struct sizeof_
|
||||
{
|
||||
typedef int_< sizeof(T) > type;
|
||||
};
|
||||
<p>
|
||||
<span class="cxx-comment">// binary metafunction</span>
|
||||
template< typename T1, typename T2 >
|
||||
struct is_same
|
||||
{
|
||||
typedef false_ type;
|
||||
};
|
||||
<p>
|
||||
template< typename T >
|
||||
struct is_same<T,T>
|
||||
{
|
||||
typedef true_ type;
|
||||
};
|
||||
<p>
|
||||
<span class="cxx-comment">// invocations</span>
|
||||
typedef always_true::type t1;
|
||||
typedef sizeof_<int>::type t2;
|
||||
typedef is_same<int,char>::type t3;
|
||||
<p>
|
||||
<span class="cxx-comment">// results checks</span>
|
||||
BOOST_STATIC_ASSERT(t1::value);
|
||||
BOOST_STATIC_ASSERT(t2::value == sizeof(int));
|
||||
BOOST_STATIC_ASSERT(!t3::value);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/plus.html">plus</a></code>
|
||||
<li><code><a href="./Reference/not.html">not_</a></code>
|
||||
<li><code><a href="./Reference/size.html">size</a></code>
|
||||
<li><code><a href="./Reference/max_element.html">max_element</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Metafunctions.html">Metafunctions</a>, <a href="./Metafunction_Class.html">Metafunction Class</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 3:27 am</body></html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=../index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../index.html">../index.html</a>.
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,67 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Metafunction Class</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Metafunction Class</h1><h3>Description</h3>
|
||||
<p>
|
||||
A <em>metafunction class</em> is a certain form of metafunction representation that enables higher-order metaprogramming. In particular, a non-nullary metafunction class is a type with a nested class template member <code>apply</code>. A nullary metafunction class has the form of a <a href="./Metafunction.html">nullary metafunction</a>. A metafunction class invocation is defined as invocation of its nested <code>apply</code> <a href="./Metafunction.html">metafunction</a>.
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename f::type</code></td><td>A type </td></tr>
|
||||
<tr><td><code>typename f::template apply<a1,..,an>::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>typename f::type</code></td><td>unspecified</td><td><code>f</code> is a nullary metafunction class; <code>f::type</code> is a <em>type-name</em></td><td><code>f::type</code> is the result of the metafunction class invocation</td><td></td></tr>
|
||||
<tr><td><code>typename f::template apply<a1,..,an>::type</code></td><td>unspecified</td><td><code>f</code> is an <code>n</code>-ary metafunction class; <code>apply</code> is a <a href="./Metafunction.html">metafunction</a></td><td><code>typename f::template apply<a1,..,an>::type</code> is the result of the metafunction class invocation with the actual arguments <code>a1,..,an</code></td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
<span class="cxx-comment">// nullary metafunction class</span>
|
||||
struct always_true { typedef true_ type; };
|
||||
<p>
|
||||
template< long N > struct le
|
||||
{
|
||||
template< typename M > struct apply
|
||||
{
|
||||
typedef bool_< (M::value < N) > type;
|
||||
};
|
||||
};
|
||||
<p>
|
||||
<span class="cxx-comment">// unary metafunction class</span>
|
||||
typedef le<5> less_than_5;
|
||||
<p>
|
||||
<span class="cxx-comment">// binary metafunction class</span>
|
||||
struct less_than
|
||||
{
|
||||
template< typename N1, typename N2 > struct apply
|
||||
{
|
||||
typedef bool_< (N1::value < N2::value) > type;
|
||||
};
|
||||
};
|
||||
<p>
|
||||
<span class="cxx-comment">// invocations</span>
|
||||
typedef always_true::type t1;
|
||||
typedef less_than_5::apply< int_<7> >::type t2;
|
||||
typedef less_than::apply< int_<5>,int_<7> >::type t3;
|
||||
<p>
|
||||
<span class="cxx-comment">// results checks</span>
|
||||
BOOST_STATIC_ASSERT(t1::value);
|
||||
BOOST_STATIC_ASSERT(!t2::value);
|
||||
BOOST_STATIC_ASSERT(t3::value);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Metafunctions.html">Metafunctions</a>, <a href="./Metafunction.html">Metafunction</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 4:16 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Metafunctions</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>Metafunctions</h1><h4>Concepts</h4>
|
||||
<ul>
|
||||
<li><a href="./Metafunction.html">Metafunction</a>
|
||||
<li><a href="./Metafunction_Class.html">Metafunction Class</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Invocation</h4>
|
||||
<ul>
|
||||
<li>apply
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Arithmetic operations </h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/plus.html">plus</a>
|
||||
<li><a href="./Reference/minus.html">minus</a>
|
||||
<li><a href="./Reference/multiplies.html">multiplies</a>
|
||||
<li><a href="./Reference/divides.html">divides</a>
|
||||
<li><a href="./Reference/modulus.html">modulus</a>
|
||||
<li><a href="./Reference/negate.html">negate</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Comparisons </h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/equal_to.html">equal_to</a>
|
||||
<li><a href="./Reference/not_equal_to.html">not_equal_to</a>
|
||||
<li><a href="./Reference/less.html">less</a>
|
||||
<li><a href="./Reference/greater.html">greater</a>
|
||||
<li><a href="./Reference/less_equal.html">less_equal</a>
|
||||
<li><a href="./Reference/greater_equal.html">greater_equal</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Logical operations </h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/or.html">or_</a>
|
||||
<li><a href="./Reference/and.html">and_</a>
|
||||
<li><a href="./Reference/not.html">not_</a>
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Bitwise operations </h4>
|
||||
<ul>
|
||||
<li>bitor_
|
||||
<li>bitand_
|
||||
<li>bitxor_
|
||||
<li>shift_left
|
||||
<li>shift_right
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Identity operations</h4>
|
||||
<ul>
|
||||
<li>identity
|
||||
<li>project1st
|
||||
<li>project2nd
|
||||
<li>select1st
|
||||
<li>select2nd
|
||||
</ul>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:39 am</body></html>
|
@@ -1,48 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Random Access Iterator</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>Random Access Iterator</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Random Access Iterator is a <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a> that provides constant-time methods for moving forward and backward on a sequence in arbitrary-sized steps.
|
||||
<p>
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Random Access Iterator defines two new expressions and refines the ones described in <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename i::next</code></td><td>A model of <a href="./Random_Access_Iterator.html">Random Access Iterator</a> </td></tr>
|
||||
<tr><td><code>typename i::prior</code></td><td>A model of <a href="./Random_Access_Iterator.html">Random Access Iterator</a> </td></tr>
|
||||
<tr><td><code>typename i::template advance<n>::type</code></td><td>A model of <a href="./Random_Access_Iterator.html">Random Access Iterator</a> </td></tr>
|
||||
<tr><td><code>typename i::template distance<j>::type</code></td><td>A model of <a href="./Integral_Constant.html">Integral Constant</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
Semantics of an expression is defined only where it is not defined in <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Complexity </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typename i::template advance<n>::type</code></td><td>Amortized constant time</td><td>Including <code>i</code> itself, there must be <code>n::value</code> dereferenceable or past-the-end iterators following or preceding <code>i</code>, depending on whether <code>n</code> is positive or negative.</td><td>If <code>n::value > 0</code>, equivalent to executing <code>i::next</code> <code>n::value</code> times; if <code>n::value < 0</code>, equivalent to executing <code>i::prior</code> <code>n::value</code> times; if <code>n::value == 0</code>, this is a null operation [<a href="#1">1</a>].</td><td>The resulting iterator is dereferenceable or past-the-end. </td></tr>
|
||||
<tr><td><code>typename i::template distance<j>::type</code></td><td>Amortized constant time</td><td>Either <code>i</code> is reachable from <code>j</code> or <code>j</code> is reachable from <code>i</code>, or both.</td><td>Returns an integral constant <code>n</code> such that <code>i::template advance<n>::type</code> is identical to <code>j</code>. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any random access iterators <code>i</code> and <code>j</code> the following invariants always hold:
|
||||
<p>
|
||||
<ul>
|
||||
<li>if <code>i::advance<n>::type</code> is well-defined, then <code>i::advance<n>::type::advance< <a href="./Reference/negate.html">negate</a><n>::type >::type</code> is a null operation.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Random_Access_Sequence.html">Random Access Sequence</a>, <a href="./Bidirectional_Iterator.html">Bidirectional Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 11:35 am</body></html>
|
@@ -1,35 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Random Access 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>Random Access Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Random Access Sequence is a <a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a> which provides iterators that satisfy the <a href="./Random_Access_Iterator.html">Random Access Iterator</a> requirements. A random access sequence provides amortized constant time access to arbitrary elements.
|
||||
<p>
|
||||
<h3>Refinement of</h3>
|
||||
<p>
|
||||
<a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
Random Access Sequence does not define any new expressions beyond those defined in <a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>. However, it refines the expression requirements.
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename begin<s>::type</code></td><td>A model of <a href="./Random_Access_Iterator.html">Random Access Iterator</a> </td></tr>
|
||||
<tr><td><code>typename end<s>::type</code></td><td>A model of <a href="./Random_Access_Iterator.html">Random Access Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/vector.html">vector</a></code>
|
||||
<li><code><a href="./Reference/vector_c.html">vector_c</a></code>
|
||||
<li><code><a href="./Reference/range_c.html">range_c</a></code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>, <a href="./Random_Access_Iterator.html">Random Access Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 2:37 pm</body></html>
|
@@ -1,37 +0,0 @@
|
||||
<!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>
|
@@ -1,50 +0,0 @@
|
||||
<!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>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::advance</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 6:38 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::and_</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>and_</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename F1
|
||||
, typename F2
|
||||
, typename F3 = true_
|
||||
...
|
||||
, typename Fn = true_
|
||||
>
|
||||
struct 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/and.hpp">boost/mpl/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> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></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>
|
||||
<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((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 September 6, 2003 3:13 am</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::at</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>at</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename N
|
||||
>
|
||||
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>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>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>
|
||||
</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<Sequence,N>::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< range, int_<0> >::type::value == 10);
|
||||
BOOST_STATIC_ASSERT(at< range, int_<10> >::type::value == 20);
|
||||
BOOST_STATIC_ASSERT(at< range, int_<40> >::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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:26 am</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::at_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>at_c</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, long n
|
||||
>
|
||||
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<Sequence,n>::type</code> is a shorcut notation for <code>at< Sequence, integral_c<long,n> >::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>Sequence</code></td><td>A model of <a href="../Forward_Sequence.html">Forward Sequence</a></td><td>A sequence being examined. </td></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>
|
||||
</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<Sequence,n>::type t;</code></td><td>A type</td><td><code>0 <= n < size<Sequence>::type::value</code></td><td>Equivalent to <code>typedef at< Sequence, integral_c<long,n> >::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<range,0>::type::value == 10);
|
||||
BOOST_STATIC_ASSERT(at_c<range,10>::type::value == 20);
|
||||
BOOST_STATIC_ASSERT(at_c<range,40>::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_Contents.html">Table of Contents</a><br>Last edited October 21, 2002 4:09 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::back</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:47 am</body></html>
|
@@ -1,56 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::begin</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>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_Contents.html">Table of Contents</a><br>Last edited July 22, 2002 2:03 am</body></html>
|
@@ -1,60 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::clear</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:58 am</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::contains</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>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_</code> if one or more elements in <code>Sequence</code> are identical to <code>T</code>, and <code>false_</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/not.html">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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:33 am</body></html>
|
@@ -1,70 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::copy</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>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>
|
||||
, 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);
|
||||
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_Contents.html">Table of Contents</a><br>Last edited May 20, 2003 1:36 am</body></html>
|
@@ -1,70 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::copy_backward</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>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_Contents.html">Table of Contents</a><br>Last edited July 19, 2002 2:11 am</body></html>
|
@@ -1,70 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::copy_backward_if</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>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><_1,_2>
|
||||
, <a href="../Reference/less.html">less</a><_1,int_<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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:29 am</body></html>
|
@@ -1,70 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::copy_if</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>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><_1,_2>
|
||||
, <a href="../Reference/less.html">less</a><_1,int_<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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:30 am</body></html>
|
@@ -1,60 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::count</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>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.hpp">boost/mpl/count.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_Contents.html">Table of Contents</a><br>Last edited December 12, 2002 2:05 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::count_if</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>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,next<_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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 4:32 am</body></html>
|
@@ -1,56 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::deref</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>deref</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Iterator
|
||||
>
|
||||
struct deref
|
||||
{
|
||||
typedef typename Iterator::type type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Dereferences an iterator.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/deref.hpp">boost/mpl/deref.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
||||
<tr><td><code>Iterator</code></td><td>A model of <a href="../Trivial_Iterator.html">Trivial Iterator</a></td><td>An iterator to be dereferenced. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef deref<Iterator>::type t;</code></td><td>A type</td><td></td><td>Equivalent to <code>typedef Iterator::type t;</code>.</td><td><code>Iterator</code> is dereferenceable </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list.html">list</a><char,short,int,long> types;
|
||||
typedef <a href="../Reference/begin.html">begin</a><types>::type iter;
|
||||
BOOST_STATIC_ASSERT(boost::is_same< deref<iter>::type,char >::value));
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Iterators.html">Iterators</a>, <code><a href="../Reference/begin.html">begin</a>/<a href="../Reference/end.html">end</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:30 am</body></html>
|
@@ -1,56 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::distance</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 6:47 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::divides</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>divides</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
, typename T3 = integral_c<int,1>
|
||||
, ...
|
||||
, typename 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/divides.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:32 am</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::empty</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:52 am</body></html>
|
@@ -1,57 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::end</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>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_Contents.html">Table of Contents</a><br>Last edited July 22, 2002 4:30 pm</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::equal</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>equal</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence1
|
||||
, typename Sequence2
|
||||
, typename Pred = is_same<_1,_2>
|
||||
>
|
||||
struct equal
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if the two sequences <code>Sequence1</code> and <code>Sequence2</code> are identical when compared element-by-element, and otherwise returns <code>false_</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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:39 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::equal_to</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>equal_to</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct equal_to
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value == T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/equal_to.hpp">boost/mpl/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_<(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<_1,int_<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_<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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:26 am</body></html>
|
@@ -1,65 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::erase</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:59 am</body></html>
|
@@ -1,63 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::erase_range</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>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_Contents.html">Table of Contents</a><br>Last edited February 19, 2002 3:55 am</body></html>
|
@@ -1,63 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::filter_view</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>filter_view</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename Pred
|
||||
>
|
||||
struct filter_view
|
||||
{
|
||||
<span class="cxx-comment">// unspecified</span>
|
||||
};
|
||||
</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 <a href="../Reference/max_element.html">max_element</a><
|
||||
<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/joint_view.html">joint_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>, <code><a href="../Reference/max_element.html">max_element</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 4:42 am</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::find</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>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::pos::value == 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_Contents.html">Table of Contents</a><br>Last edited September 15, 2002 7:24 pm</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::find_if</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>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::pos::value == 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_Contents.html">Table of Contents</a><br>Last edited September 15, 2002 7:24 pm</body></html>
|
@@ -1,65 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::fold</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>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>,next<_1>,_1 >
|
||||
>::type number_of_floats;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(number_of_floats::value == 4);
|
||||
</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_Contents.html">Table of Contents</a><br>Last edited December 12, 2002 4:42 pm</body></html>
|
@@ -1,75 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::fold_backward</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>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_<0> >, push_front<_1,_2,>, _1 >
|
||||
>::type result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(<a href="../Reference/equal.html">equal</a>< negatives,result >::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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:30 am</body></html>
|
@@ -1,60 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::front</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:48 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::greater</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>greater</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct greater
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value > T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/greater.hpp">boost/mpl/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_<(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<_1,int_<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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:24 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::greater_equal</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>greater_equal</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct greater_equal
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value > T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/greater_equal.hpp">boost/mpl/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_<(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<_1,int_<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> >::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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:25 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::insert</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 5:17 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::insert_range</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>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_Contents.html">Table of Contents</a><br>Last edited July 22, 2002 4:32 pm</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!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>
|
@@ -1,65 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::iter_fold</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>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>< <a href="../Reference/deref.html">deref</a><_1>, <a href="../Reference/deref.html">deref</a><_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_Contents.html">Table of Contents</a><br>Last edited July 19, 2002 1:16 am</body></html>
|
@@ -1,71 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::iter_fold_backward</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>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>< <a href="../Reference/deref.html">deref</a><_2>,int_<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,<a href="../Reference/deref.html">deref</a><_1> > >::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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:31 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::iterator_category</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 6:20 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::joint_view</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>joint_view</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence1
|
||||
, typename Sequence2
|
||||
>
|
||||
struct joint_view
|
||||
{
|
||||
<span class="cxx-comment">// unspecified</span>
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
<code>joint_view</code> is a two-sequence view that allows one to operate on a sequence of concatenated elements of sequences <code>Sequence1</code> and <code>Sequence2</code> without actually creating one.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/joint_view.hpp">boost/mpl/joint_view.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
||||
<tr><td><code>Sequence1</code>, <code>Sequence2</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td>Sequences to concatenate. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef joint_view<Sequence1,Sequence2> s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> prodives iterators to all the elements in the ranges <code>[<a href="../Reference/begin.html">begin</a><Sequence1>::type,<a href="../Reference/end.html">end</a><Sequence1>::type)</code>, <code>[<a href="../Reference/begin.html">begin</a><Sequence2>::type,<a href="../Reference/end.html">end</a><Sequence2>::type)</code>.</td><td><code><a href="../Reference/size.html">size</a><s>::type::value == <a href="../Reference/size.html">size</a>< Sequence1 >::type::value + <a href="../Reference/size.html">size</a>< Sequence2 >::type::value</code>. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef joint_view<
|
||||
<a href="../Reference/range_c.html">range_c</a><int,0,10>
|
||||
, <a href="../Reference/range_c.html">range_c</a><int,10,15>
|
||||
> numbers;
|
||||
<p>
|
||||
typedef <a href="../Reference/range_c.html">range_c</a><int,0,15> answer;
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/equal.html">equal</a><numbers,answer>::type::value));
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:42 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::less</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>less</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct less
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value < T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/less.hpp">boost/mpl/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_<(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<_1,int_<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> >::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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:22 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::less_equal</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>less_equal</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct less_equal
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value <= T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/less_equal.hpp">boost/mpl/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_<(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<_1,int_<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> >::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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:28 am</body></html>
|
@@ -1,45 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::list</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:05 am</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::list_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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:04 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::lower_bound</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>lower_bound</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename T
|
||||
, typename Pred = <a href="../Reference/less.html">less</a><_,_>
|
||||
>
|
||||
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_<3> >::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));
|
||||
BOOST_STATIC_ASSERT(iter::type::value == 3);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Algorithms.html">Algorithms</a>, <code>sort</code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:43 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::max_element</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>max_element</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename Pred = <a href="../Reference/less.html">less</a><_1,_2>
|
||||
>
|
||||
struct max_element
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Finds the largest element in the <code>Sequence</code>.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/max_element.hpp">boost/mpl/max_element.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> 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 searched. </td></tr>
|
||||
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A comparison criteria. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef max_element< 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 <code>[begin<Sequence>::type, end<Sequence>::type)</code> such that for every iterator <code>j</code> in <code>[begin<Sequence>::type, end<Sequence>::type)</code>, <code>apply< lambda<Pred>::type, i::type, j::type >::type::value == false</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Zero comparisons if <code>Sequence</code> is empty, otherwise exactly <code>size<Sequence>::value - 1</code> comparisons.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><int,char[50],long,double> types;
|
||||
typedef max_element<
|
||||
<a href="../Reference/transform_view.html">transform_view</a>< types,sizeof_<_1> >
|
||||
>::type iter;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>< begin<types>::type,iter >::type::value == 1));
|
||||
BOOST_STATIC_ASSERT(sizeof(<a href="../Reference/deref.html">deref</a><iter>::type) == 50);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/min_element.html">min_element</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:01 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::min_element</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>min_element</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename Pred = <a href="../Reference/less.html">less</a><_1,_2>
|
||||
>
|
||||
struct min_element
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Finds the smallest element in the <code>Sequence</code>.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/min_element.hpp">boost/mpl/min_element.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> 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 searched. </td></tr>
|
||||
<tr><td><code>Pred</code></td><td>A model of binary Predicate [Lambda Expression]</td><td>A comparison criteria. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef min_element< 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 <code>[begin<Sequence>::type, end<Sequence>::type)</code> such that for every iterator <code>j</code> in <code>[begin<Sequence>::type, end<Sequence>::type)</code>, <code>apply< lambda<Pred>::type, j::type, i::type >::type::value == false</code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Linear. Zero comparisons if <code>Sequence</code> is empty, otherwise exactly <code>size<Sequence>::value - 1</code> comparisons.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/vector.html">vector</a><bool,char[50],long,double> types;
|
||||
typedef min_element<
|
||||
<a href="../Reference/transform_view.html">transform_view</a>< types,sizeof_<_1> >
|
||||
>::type iter;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((<a href="../Reference/distance.html">distance</a>< begin<types>::type,iter >::type::value == 0));
|
||||
BOOST_STATIC_ASSERT(sizeof(<a href="../Reference/deref.html">deref</a><iter>::type) == sizeof(bool));
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/max_element.html">max_element</a></code>, <code><a href="../Reference/upper_bound.html">upper_bound</a></code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:05 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::minus</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>minus</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
, typename T3 = integral_c<int,0>
|
||||
, ...
|
||||
, typename 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/minus.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:31 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::modulus</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>modulus</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename 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/modulus.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:32 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::multiplies</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>multiplies</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
, typename T3 = integral_c<int,1>
|
||||
, ...
|
||||
, typename 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/multiplies.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:31 am</body></html>
|
@@ -1,60 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::negate</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>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/negate.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:33 am</body></html>
|
@@ -1,51 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::not_</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>not_</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename F
|
||||
>
|
||||
struct not_
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns the result of <em>logical not</em> (<code>!</code>) operation on its argument.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/not.hpp">boost/mpl/not.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> 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>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_>::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 September 6, 2003 3:09 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::not_equal_to</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>not_equal_to</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
>
|
||||
struct not_equal_to
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns <code>true_</code> if <code>T1::value != T2::value</code> and <code>false_</code> otherwise [<a href="#1">1</a>].
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/not_equal_to.hpp">boost/mpl/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_<(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<_1,int_<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><_1,int_<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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:20 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::or_</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>or_</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename F1
|
||||
, typename F2
|
||||
, typename F3 = false_
|
||||
...
|
||||
, typename Fn = false_
|
||||
>
|
||||
struct or_
|
||||
{
|
||||
typedef <em>unspecified</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Returns the result of short-circuit <em>logical or</em> (<code>||</code>) operation on its arguments.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/or.hpp">boost/mpl/or.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> 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>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>
|
||||
<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((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 September 6, 2003 3:14 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::plus</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>plus</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T1
|
||||
, typename T2
|
||||
, typename T3 = integral_c<int,0>
|
||||
, ...
|
||||
, typename 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/plus.hpp">boost/mpl/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_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:30 am</body></html>
|
@@ -1,71 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::pop_back</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:56 am</body></html>
|
@@ -1,71 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::pop_front</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:54 am</body></html>
|
@@ -1,63 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::push_back</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>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_>::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><_1,false_> >::type::value == 6));
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
[<a name="1">1</a>] The algorithm 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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:34 am</body></html>
|
@@ -1,64 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::push_front</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>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 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_Contents.html">Table of Contents</a><br>Last edited September 11, 2002 4:27 am</body></html>
|
@@ -1,71 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::range_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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:31 am</body></html>
|
@@ -1,72 +0,0 @@
|
||||
<!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/math/rational_c.hpp">boost/mpl/math/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>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::remove</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:43 am</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::remove_if</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:43 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::replace</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 5:38 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::replace_if</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>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_<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 >::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_Contents.html">Table of Contents</a><br>Last edited March 12, 2003 6:32 am</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::reverse</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>reverse</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
>
|
||||
struct reverse
|
||||
{
|
||||
typedef <em>implementation-defined</em> type;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Reverses a sequence. 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/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></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>
|
||||
</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 reverse<Sequence>::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.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/list_c.html">list_c</a><int,9,8,7,6,5,4,3,2,1,0>::type numbers;
|
||||
typedef reverse< numbers >::type result;
|
||||
<p>
|
||||
typedef <a href="../Reference/range_c.html">range_c</a><int,0,10> 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/transform.html">transform</a></code>, <code><a href="../Reference/remove.html">remove</a></code>, <code><a href="../Reference/remove_if.html">remove_if</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:13 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::single_view</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>single_view</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename T
|
||||
>
|
||||
struct single_view
|
||||
{
|
||||
<span class="cxx-comment">// unspecified</span>
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
Allows one to represent an arbitrary type <code>T</code> as a single-element sequence.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/single_view.hpp">boost/mpl/single_view.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
||||
<tr><td><code>T</code></td><td>A type</td><td>The type to be wrapped in a sequence. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef single_view<T> s;</code></td><td>A model of <a href="../Sequence.html">Sequence</a></td><td></td><td><code>s</code> is a random-access, single-element sequence such as <code><a href="../Reference/front.html">front</a><s>::type</code> is identical to <code>T</code></td><td><code><a href="../Reference/size.html">size</a><s>::type::value == 1, boost::same_as<<a href="../Reference/front.html">front</a><s>::type,T>::value == true</code>. </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef single_view<int> view;
|
||||
typedef <a href="../Reference/begin.html">begin</a><view>::type first;
|
||||
typedef <a href="../Reference/end.html">end</a><view>::type last;
|
||||
<p>
|
||||
BOOST_MPL_ASSERT_IS_SAME(first::type,int);
|
||||
BOOST_MPL_ASSERT_IS_SAME(first::next,last);
|
||||
BOOST_MPL_ASSERT_IS_SAME(last::prior,first);
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT(size<view>::type::value == 1);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/joint_view.html">joint_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:19 am</body></html>
|
@@ -1,60 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::size</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 3:51 am</body></html>
|
@@ -1,59 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::transform</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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 5:47 am</body></html>
|
@@ -1,62 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::transform_view</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>transform_view</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename F
|
||||
>
|
||||
struct transform_view
|
||||
{
|
||||
<span class="cxx-comment">// unspecified</span>
|
||||
};
|
||||
</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 <a href="../Reference/max_element.html">max_element</a><
|
||||
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/joint_view.html">joint_view</a></code>, <code><a href="../Reference/zip_view.html">zip_view</a></code>, <code><a href="../Reference/max_element.html">max_element</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 4:43 am</body></html>
|
@@ -1,61 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::upper_bound</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>upper_bound</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequence
|
||||
, typename T
|
||||
, typename Pred = <a href="../Reference/less.html">less</a><_1,_2>
|
||||
>
|
||||
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_<3> >::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));
|
||||
BOOST_STATIC_ASSERT(iter::type::value == 5);
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Algorithms.html">Algorithms</a>, <code>sort</code>, <code><a href="../Reference/lower_bound.html">lower_bound</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:44 am</body></html>
|
@@ -1,77 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::vector</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>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_Contents.html">Table of Contents</a><br>Last edited July 22, 2002 4:28 pm</body></html>
|
@@ -1,58 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::vector_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>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_Contents.html">Table of Contents</a><br>Last edited July 17, 2002 8:01 am</body></html>
|
@@ -1,66 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::zip_view</title>
|
||||
<link rel="stylesheet" href="../mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>zip_view</h1><h3>Synopsis</h3>
|
||||
<p>
|
||||
<pre>
|
||||
template<
|
||||
typename Sequences
|
||||
>
|
||||
struct zip_view
|
||||
{
|
||||
<span class="cxx-comment">// unspecified</span>
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Description</h3>
|
||||
<p>
|
||||
<code>zip_view</code> provides a "zipped" view onto several sequences; that is, it allows to represent several sequences as a single sequence of elements each of those, in its turn, is a sequence of the corresponding <code>Sequences</code> elements.
|
||||
<p>
|
||||
<h3>Definition</h3>
|
||||
<p>
|
||||
<pre>
|
||||
#include "<a href="../../../../../boost/mpl/zip_view.hpp">boost/mpl/zip_view.hpp</a>"
|
||||
</pre>
|
||||
<p>
|
||||
<h3>Parameters</h3>
|
||||
<table border="1">
|
||||
<tr><th> Parameter </th><th> Requirement </th><th> Description </th></tr>
|
||||
<tr><td><code>Sequences</code></td><td>A <a href="../Sequence.html">Sequence</a> of <a href="../Sequence.html">Sequence</a>s</td><td>Sequences to be "zipped". </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
||||
<tr><td><code>typedef zip_view<Sequences> 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><Sequences>::type, <a href="../Reference/end.html">end</a><Sequences>::type)</code> <code>i::type</code> is identical to <code><a href="../Reference/transform.html">transform</a><j::type, <a href="../Reference/deref.html">deref</a><_1> >::type </code>.</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Complexity</h3>
|
||||
<p>
|
||||
Amortized constant time.
|
||||
<p>
|
||||
<h3>Example</h3>
|
||||
<p>
|
||||
<pre>
|
||||
typedef <a href="../Reference/range_c.html">range_c</a><int,0,10> s1;
|
||||
typedef range_c<int,10,20> s2;
|
||||
<p>
|
||||
typedef <a href="../Reference/transform_view.html">transform_view</a><
|
||||
<a href="../Reference/zip_view.html">zip_view</a>< <a href="../Reference/list.html">list</a><s1,s2> >
|
||||
, apply_seq< <a href="../Reference/plus.html">plus</a><_1,_2> >
|
||||
> result;
|
||||
<p>
|
||||
BOOST_STATIC_ASSERT((equal<
|
||||
result
|
||||
, <a href="../Reference/filter_view.html">filter_view</a>< range_c<int,10,30>, math::is_even<_1> >
|
||||
, <a href="../Reference/equal_to.html">equal_to</a><_1,_2>
|
||||
>::type::value));
|
||||
</pre>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="../Sequences.html">Sequences</a>, <code><a href="../Reference/transform_view.html">transform_view</a></code>, <code><a href="../Reference/filter_view.html">filter_view</a></code>, <code><a href="../Reference/joint_view.html">joint_view</a></code>, <code><a href="../Reference/equal.html">equal</a></code>
|
||||
<p><hr>
|
||||
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:04 am</body></html>
|
@@ -1,49 +1,10 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::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>Sequence</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Sequence (or, more precisely, an Input Sequence) is a compile-time entity to which you can apply <code><a href="./Reference/begin.html">begin</a></code>/<code><a href="./Reference/end.html">end</a></code> operations in order to get iterators for accessing the range of its elements. In general, a sequence does not guarantee that its content doesn't change from one iteration to another, or between different compilation sessions [<a href="#1">1</a>]. See <a href="./Forward_Sequence.html">Forward Sequence</a> for the definition of the concept that imposes such additional requirements.
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename begin<s>::type</code></td><td>A model of <a href="./Input_Iterator.html">Input Iterator</a> </td></tr>
|
||||
<tr><td><code>typename end<s>::type</code></td><td>A model of <a href="./Input_Iterator.html">Input Iterator</a> </td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Expression semantics</h3>
|
||||
<p>
|
||||
See the description of <a href="./Reference/begin.html">begin</a>/<a href="./Reference/end.html">end</a> operations.
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any sequence <code>s</code> the following invariants always hold:
|
||||
<ul>
|
||||
<li><code>[begin<s>::type, end<s>::type)</code> is always a valid range;
|
||||
<li>an algorithm that iterates through the range <code>[begin<s>::type, end<s>::type)</code> will pass through every element of <code>s</code> (once);
|
||||
<li><code>begin<s>::type</code> is identical to <code>end<s>::type</code> if and only if the sequence <code>s</code> is empty.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Models</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li><code><a href="./Reference/vector.html">vector</a></code>
|
||||
<li><code><a href="./Reference/vector_c.html">vector_c</a></code>
|
||||
<li><code><a href="./Reference/list.html">list</a></code>
|
||||
<li><code><a href="./Reference/list_c.html">list_c</a></code>
|
||||
<li><code><a href="./Reference/range_c.html">range_c</a></code>
|
||||
<li><code>iterator_range</code>
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
[<a name="1">1</a>] For example, a sequence might implement an interface to a compile-time random-number generator; for such sequence the <code>begin/end</code> invocation might return different iterators on every subsequent compilation of the code.<br>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Sequences.html">Sequences</a>, <a href="./Forward_Sequence.html">Forward Sequence</a>, <a href="./Input_Iterator.html">Input Iterator</a>, <code><a href="./Reference/begin.html">begin</a></code>, <code><a href="./Reference/end.html">end</a></code>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 21, 2002 5:55 pm</body></html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=../index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../index.html">../index.html</a>.
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,64 +1,10 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Sequences</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>Sequences</h1><h4>Concepts</h4>
|
||||
<ul>
|
||||
<li><a href="./Sequence.html">Sequence</a>
|
||||
<li><a href="./Forward_Sequence.html">Forward Sequence</a>
|
||||
<li><a href="./Bidirectional_Sequence.html">Bidirectional Sequence</a>
|
||||
<li><a href="./Random_Access_Sequence.html">Random Access Sequence</a>
|
||||
<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>
|
||||
<li><a href="./Reference/list.html">list</a>
|
||||
<li><a href="./Reference/vector_c.html">vector_c</a>
|
||||
<li><a href="./Reference/list_c.html">list_c</a>
|
||||
<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>
|
||||
<li><a href="./Reference/filter_view.html">filter_view</a>
|
||||
<li><a href="./Reference/joint_view.html">joint_view</a>
|
||||
<li><a href="./Reference/zip_view.html">zip_view</a>
|
||||
<li><a href="./Reference/single_view.html">single_view</a>
|
||||
<li>as_sequence
|
||||
</ul>
|
||||
<p>
|
||||
<h4>Intrinsic Metafunctions</h4>
|
||||
<ul>
|
||||
<li><a href="./Reference/begin.html">begin</a>/<a href="./Reference/end.html">end</a>
|
||||
<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>
|
||||
<li><a href="./Reference/back.html">back</a>
|
||||
<li><a href="./Reference/at.html">at</a>/<a href="./Reference/at_c.html">at_c</a>
|
||||
<li><a href="./Reference/push_front.html">push_front</a>
|
||||
<li><a href="./Reference/push_back.html">push_back</a>
|
||||
<li><a href="./Reference/pop_front.html">pop_front</a>
|
||||
<li><a href="./Reference/pop_back.html">pop_back</a>
|
||||
<li><a href="./Reference/clear.html">clear</a>
|
||||
<li><a href="./Reference/insert.html">insert</a>
|
||||
<li><a href="./Reference/insert_range.html">insert_range</a>
|
||||
<li><a href="./Reference/erase.html">erase</a>
|
||||
</ul>
|
||||
<p>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 1, 2003 3:47 pm</body></html>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=../index.html">
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="../index.html">../index.html</a>.
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,16 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Table of Contents</title>
|
||||
<link rel="stylesheet" href="./mpl_wiki.css">
|
||||
</head><body bgcolor="white">
|
||||
<h1><a href="./Table_of_Contents.html"><img src="./mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>Table of Contents</h1><ol>
|
||||
<li><a href="./Sequences.html">Sequences</a>
|
||||
<li><a href="./Iterators.html">Iterators</a>
|
||||
<li><a href="./Algorithms.html">Algorithms</a>
|
||||
<li><a href="./Metafunctions.html">Metafunctions</a>
|
||||
<li><a href="./Integral_constant_classes.html">Integral constant classes</a>
|
||||
<li><a href="./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 November 6, 2003 11:39 am</body></html>
|
@@ -1,46 +0,0 @@
|
||||
<!doctype html public "-//ietf//dtd html//en">
|
||||
<html><head><title>boost::mpl::Trivial Iterator</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>Trivial Iterator</h1><h3>Description</h3>
|
||||
<p>
|
||||
A Trivial Iterator <code>i</code> is a type that represents a reference to an element of some <a href="./Sequence.html">Sequence</a>, and allows to access the element through its nested <code>type</code> member [<a href="#1">1</a>]. A trivial iterator does not define any traversal operations.
|
||||
<p>
|
||||
<h3>Definitions</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li>a trivial iterator can be <em>dereferenceable</em>, meaning that accessing its nested <code>type</code> member is a well-defined operation.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Valid expressions</h3>
|
||||
<p>
|
||||
<table border="1">
|
||||
<tr><th> Expression </th><th> Expression type </th></tr>
|
||||
<tr><td><code>typename i::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>typename i::type</code></td><td>Amortized constant time</td><td><code>i</code> is dereferenceable</td><td><code>i::type</code> is identical to the type of the pointed element</td><td></td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<h3>Invariants</h3>
|
||||
<p>
|
||||
For any trivial iterators <code>i</code> and <code>j</code> the following invariants always hold:
|
||||
<p>
|
||||
<ul>
|
||||
<li><code>i</code> and <code>j</code> are identical if and only if they are pointing to the same element;
|
||||
<li>if <code>i</code> is dereferenceable, and <code>j</code> is identical to <code>i</code>, then <code>j</code> is dereferenceable as well;
|
||||
<li>if <code>i</code> and <code>j</code> are identical and dereferenceable, then <code>i::type</code> and <code>j::type</code> are identical.
|
||||
</ul>
|
||||
<p>
|
||||
<h3>Notes</h3>
|
||||
[<a name="1">1</a>] Any trivial iterator is a model of [Nullary Metafunction Class] concept. <br>
|
||||
<p>
|
||||
<h3>See also</h3>
|
||||
<p>
|
||||
<a href="./Sequence.html">Sequence</a>, <a href="./Input_Iterator.html">Input Iterator</a>
|
||||
<p><hr>
|
||||
<a href="./Table_of_Contents.html">Table of Contents</a><br>Last edited July 15, 2002 10:46 am</body></html>
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user