# remove

### Synopsis

    template<
          typename Sequence
        , typename T
        >
    struct remove
    {
        typedef unspecified type;
    };

### Description

Returns a new sequence which contains all the elements from `[begin<Sequence>::type, end<Sequence>::type)` range except those that are identical to `T`. The result sequence preserves all the functional and performance characteristics of the original `Sequence`, except its size and identity.

### Definition

    #include "boost/mpl/remove.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`Sequence` | A model of Extensible Sequence | The original sequence.
`T` | A type | A type to be removed.

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef remove<Sequence,T>::type s;` | A model of Extensible Sequence |  | Equivalent to `typedef remove_if< Sequence,is_same<_,T> >::type t;`. |

### Complexity

Linear. Performs exactly `size<Sequence>::type::value` comparisons for equality.

### Example

    typedef list<int,float,char,float,float,double>::type types;
    typedef remove< types,float >::type result;
    typedef list<int,char,double>::type answer;
    BOOST_STATIC_ASSERT((equal< result,answer >::type::value));

### See also

Algorithms, `remove_if`, `replace`, `replace_if`, `transform`

Table of Content | Reference
Last edited July 17, 2002 8:43 am