3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/reverse-copy-if.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Transformation Algorithms / reverse_copy_if |
template<
typename Sequence
, typename Pred
, typename In =_unspecified_>
struct[reverse\_copy\_if](./reverse-copy-if.html){
typedef_unspecified_type;
};
Returns a reversed, filtered copy of the original sequence containing the elements that satisfy the predicate Pred.
[Note: This wording applies to a no-inserter version(s) of the algorithm. See the Expression semantics subsection for a precise specification of the algorithm's details in all cases — end note]
#include <[boost/mpl/copy\_if.hpp](../../../../boost/mpl/copy_if.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence | A sequence to copy. |
| Pred | Unary Lambda Expression | A copying condition. |
| In | Inserter | An inserter. |
The semantics of an expression are defined only where they differ from, or are not defined in Reversible Algorithm.
For any Forward Sequence s, an unary Lambda Expression pred, and an Inserter in:
typedef[reverse\_copy\_if](./reverse-copy-if.html)<s,pred,in>::type r;
| Return type: |
A type
| | Semantics: |
Equivalent to
typedef[lambda](./lambda.html)<pred>::type p;
typedef[lambda](./lambda.html)<in::operation>::type op;
typedef[reverse\_fold](./reverse-fold.html)<
s
, in::state
,[eval\_if](./eval-if.html)<[apply\_wrap](./apply-wrap.html)1<p,[\_2](./placeholders.html)>
,[apply\_wrap](./apply-wrap.html)2<op,[\_1](./placeholders.html),[\_2](./placeholders.html)>
,[identity](./identity.html)<[\_1](./placeholders.html)>
>
>::type r;
|
Linear. Exactly size<s>::value applications of pred, and at most size<s>::value applications of in::operation.
typedef[reverse\_copy\_if](./reverse-copy-if.html)<[range\_c](./range-c.html)<int,0,10>
,[less](./less.html)<[\_1](./placeholders.html),[int\_](./int.html)<5> >
,[front\_inserter](./front-inserter.html)<[vector](./vector.html)<> >
>::type result;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<result>::value, ==, 5 );[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)<result,[range\_c](./range-c.html)<int,0,5> > ));
Transformation Algorithms, Reversible Algorithm, copy_if, reverse_copy, remove_if, replace_if
| 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) |