| Home | Libraries | People | FAQ | More

##### filter

###### Description

Returns the result type of `filter` given the sequence type and type to retain.

###### Synopsis

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

Table 1.77. Parameter

Parameter | Requirement | Description
--- | --- | ---
`Sequence` | A model of Forward Sequence | Operation's argument
`T` | Any type | Type to retain

###### Expression Semantics

    result_of::filter<Sequence, T>::type

Return type:

- A model of Forward Sequence.
- A model of Associative Sequence if `Sequence` implements the Associative Sequence model.

Semantics: Returns a sequence containing the elements of `Sequence` that are of type `T`. Equivalent to ``result_of::filter_if`<Sequence, boost::is_same<mpl::_, T> >::type`.

###### Complexity

Constant.

###### Header

    #include <boost/fusion/algorithm/transformation/filter.hpp>
    #include <boost/fusion/include/filter.hpp>