Back to Arangodb

remove

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

3.12.9.13.1 KB
Original Source

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

remove

Synopsis

template<
      typename Sequence
    , typename T
    , typename In =_unspecified_>
struct[remove](./remove.html){
    typedef_unspecified_type;
};

Description

Returns a new sequence that contains all elements from [begin<Sequence>::type, end<Sequence>::type) range except those that are identical to T.

[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.hpp](../../../../boost/mpl/remove.hpp)>

Model of

Reversible Algorithm

Parameters

ParameterRequirementDescription
SequenceForward SequenceAn original sequence.
TAny typeA type to be removed.
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, an Inserter in, and arbitrary type x:

typedef[remove](./remove.html)<s,x,in>::type r;

| Return type: |

A type.

| | Semantics: |

Equivalent to

typedef[remove\_if](./remove-if.html)< s,is_same<_,x>,in >::type r;

|

Complexity

Linear. Performs exactly size<s>::value comparisons for equality, and at most size<s>::value insertions.

Example

typedef[vector](./vector.html)<int,float,char,float,float,double>::type types;
typedef[remove](./remove.html)< types,float >::type result;[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)< result,[vector](./vector.html)<int,char,double> > ));

See also

Transformation Algorithms, Reversible Algorithm, reverse_remove, remove_if, copy, replace

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