1 .. Algorithms/Inserters//inserter
20 typedef Operation operation;
27 A general-purpose model of the |Inserter| concept.
35 #include <boost/mpl/inserter.hpp>
47 +---------------+-------------------------------+-----------------------------------+
48 | Parameter | Requirement | Description |
49 +===============+===============================+===================================+
50 | ``State`` | Any type | A initial state. |
51 +---------------+-------------------------------+-----------------------------------+
52 | ``Operation`` | Binary |Lambda Expression| | An output operation. |
53 +---------------+-------------------------------+-----------------------------------+
58 |Semantics disclaimer...| |Inserter|.
60 For any binary |Lambda Expression| ``op`` and arbitrary type ``state``:
62 +---------------------------+-------------------------------------------+
63 | Expression | Semantics |
64 +===========================+===========================================+
65 | ``inserter<op,state>`` | An |Inserter|. |
66 +---------------------------+-------------------------------------------+
71 Amortized constant time.
79 template< typename N > struct is_odd : bool_< ( N::value % 2 ) > {};
83 , inserter< // a filtering 'push_back' inserter
85 , if_< is_odd<_2>, push_back<_1,_2>, _1 >
89 BOOST_MPL_ASSERT(( equal< odds, vector_c<int,1,3,5,7,9>, equal_to<_,_> > ));
95 |Algorithms|, |Inserter|, |Reversible Algorithm|, |front_inserter|, |back_inserter|
97 .. |[inserter]| replace:: `inserter (class)`_
100 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
101 Distributed under the Boost Software License, Version 1.0. (See accompanying
102 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)