Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/contains.rst @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.7 KB

contains

Synopsis

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

Description

Returns a true-valued |Integral Constant| if one or more elements in Sequence are identical to T.

Parameters

Parameter Requirement Description
Sequence |Forward Sequence| A sequence to be examined.
T Any type A type to search for.

Expression semantics

For any |Forward Sequence| s and arbitrary type t:

typedef contains<s,t>::type r;
Return type:

|Integral Constant|.

Semantics:

Equivalent to

typedef not_< is_same<
      find<s,t>::type
    , end<s>::type
    > >::type r;

Complexity

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

Example

typedef vector<char,int,unsigned,long,unsigned long> types;
BOOST_MPL_ASSERT_NOT(( contains<types,bool> ));

Docutils System Messages

??????????
Note: See TracBrowser for help on using the repository browser.