boost::mpl::contains

# contains

### Synopsis

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

### Description

Returns `true_` if one or more elements in `Sequence` are identical to `T`, and `false_` otherwise.

### Definition

    #include "boost/mpl/contains.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`Sequence` | A model of Forward Sequence | A sequence to be examined.
`T` | A type | The type to search for.

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef contains<Sequence,T>::type c;` | A model of `bool` Integral Constant |  | Equivalent to `typedef not_< is_same< find<Sequence,T>::type, end<Sequence>::type > >::type c`;

### Complexity

Linear. At most `size<Sequence>::value` comparisons for identity.

### Example

    typedef vector<char,int,unsigned,long,unsigned long> types;
    typedef contains<types,bool>::type result;
    BOOST_STATIC_ASSERT(!result::value);

### See also

Algorithms, `find`, `find_if`, `count`, `count_if`

Table of Contents
Last edited March 10, 2003 5:33 am