Back to Arangodb

reverse_remove_if

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/reverse-remove-if.html

3.12.9.13.9 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Transformation Algorithms / reverse_remove_if |

reverse_remove_if

Synopsis

template<
      typename Sequence
    , typename Pred
    , typename In =_unspecified_>
struct[reverse\_remove\_if](./reverse-remove-if.html){
    typedef_unspecified_type;
};

Description

Returns a new sequence that contains all the elements from [begin<Sequence>::type, end<Sequence>::type) range in reverse order except those 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/remove\_if.hpp](../../../../boost/mpl/remove_if.hpp)>

Model of

Reversible Algorithm

Parameters

ParameterRequirementDescription
SequenceForward SequenceAn original sequence.
PredUnary Lambda ExpressionA removal condition.
InInserterAn inserter.

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in Reversible Algorithm.

For any Forward Sequence s, and an Inserter in, and an unary Lambda Expression pred:

typedef[reverse\_remove\_if](./reverse-remove-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)>
        ,[identity](./identity.html)<[\_1](./placeholders.html)>
        ,[apply\_wrap](./apply-wrap.html)2<op,[\_1](./placeholders.html),[\_2](./placeholders.html)>
        >
    >::type r;

|

Complexity

Linear. Performs exactly size<s>::value applications of pred, and at most size<s>::value insertions.

Example

typedef[vector\_c](./vector-c.html)<int,1,4,5,2,7,5,3,5>::type numbers;
typedef[reverse\_remove\_if](./reverse-remove-if.html)< numbers,[greater](./greater.html)<_,[int\_](./int.html)<4> > >::type result;[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)< result,[vector\_c](./vector-c.html)<int,3,2,4,1>,[equal\_to](./equal-to.html)<_,_> > ));

See also

Transformation Algorithms, Reversible Algorithm, remove_if, reverse_remove, reverse_copy_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) |