Back to Arangodb

inserter (class)

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/inserter-class.html

3.12.9.12.8 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Inserters / inserter (class) |

inserter (class)

Synopsis

template<
      typename State
    , typename Operation
    >
struct[inserter](./inserter-class.html){
    typedef State state;
    typedef Operation operation;
};

Description

A general-purpose model of the Inserter concept.

#include <[boost/mpl/inserter.hpp](../../../../boost/mpl/inserter.hpp)>

Model of

Inserter

Parameters

ParameterRequirementDescription
StateAny typeA initial state.
OperationBinary Lambda ExpressionAn output operation.

Expression semantics

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:

ExpressionSemantics
inserter<op,state>An Inserter.

Complexity

Amortized constant time.

Example

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)<_,_> > ));

See also

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) |