3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/inserter-class.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Inserters / inserter (class) |
template<
typename State
, typename Operation
>
struct[inserter](./inserter-class.html){
typedef State state;
typedef Operation operation;
};
A general-purpose model of the Inserter concept.
#include <[boost/mpl/inserter.hpp](../../../../boost/mpl/inserter.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| State | Any type | A initial state. |
| Operation | Binary Lambda Expression | An output operation. |
The semantics of an expression are defined only where they differ from, or are not defined in Inserter.
For any binary Lambda Expression op and arbitrary type state:
| Expression | Semantics |
|---|---|
| inserter<op,state> | An Inserter. |
Amortized constant time.
template< typename N > struct is_odd :[bool\_](./bool.html)< ( N::value % 2 ) > {};
typedef[copy](./copy.html)<[range\_c](./range-c.html)<int,0,10>
,[inserter](./inserter-class.html)< // a filtering '[push\_back](./push-back.html)'[inserter](./inserter-class.html)[vector](./vector.html)<>
,[if\_](./if.html)< is_odd<[\_2](./placeholders.html)>,[push\_back](./push-back.html)<[\_1](./placeholders.html),[\_2](./placeholders.html)>,[\_1](./placeholders.html)>
>
>::type odds;[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)< odds,[vector\_c](./vector-c.html)<int,1,3,5,7,9>,[equal\_to](./equal-to.html)<_,_> > ));
Algorithms, Inserter, Reversible Algorithm, front_inserter, back_inserter
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |