1 .. Algorithms/Transformation Algorithms//reverse_partition |185
14 , typename In1 = |unspecified|
15 , typename In2 = |unspecified|
17 struct reverse_partition
19 typedef |unspecified| type;
26 Returns a pair of sequences together containing all elements in the range
27 |begin/end<Seq>| split into two groups based on the predicate ``Pred``.
28 ``reverse_partition`` is a synonym for |reverse_stable_partition|.
30 |transformation algorithm disclaimer|
38 #include <boost/mpl/partition.hpp>
44 |Reversible Algorithm|
50 +-------------------+-----------------------------------+-------------------------------+
51 | Parameter | Requirement | Description |
52 +===================+===================================+===============================+
53 | ``Seq`` | |Forward Sequence| | An original sequence. |
54 +-------------------+-----------------------------------+-------------------------------+
55 | ``Pred`` | Unary |Lambda Expression| | A partitioning predicate. |
56 +-------------------+-----------------------------------+-------------------------------+
57 | ``In1``, ``In2`` | |Inserter| | Output inserters. |
58 +-------------------+-----------------------------------+-------------------------------+
64 |Semantics disclaimer...| |Reversible Algorithm|.
66 For any |Forward Sequence| ``s``, an unary |Lambda Expression| ``pred``, and |Inserter|\ s
72 typedef reverse_partition<s,pred,in1,in2>::type r;
82 typedef reverse_stable_partition<s,pred,in1,in2>::type r;
88 Linear. Exactly ``size<s>::value`` applications of ``pred``, and ``size<s>::value``
89 of summarized ``in1::operation`` / ``in2::operation`` applications.
97 template< typename N > struct is_odd : bool_<(N::value % 2)> {};
102 , back_inserter< vector<> >
103 , back_inserter< vector<> >
106 BOOST_MPL_ASSERT(( equal< r::first, vector_c<int,9,7,5,3,1> > ));
107 BOOST_MPL_ASSERT(( equal< r::second, vector_c<int,8,6,4,2,0> > ));
113 |Transformation Algorithms|, |Reversible Algorithm|, |partition|, |reverse_stable_partition|, |sort|
116 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
117 Distributed under the Boost Software License, Version 1.0. (See accompanying
118 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)