Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/find.rst @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 1.7 KB

find

Synopsis

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

Description

Returns an iterator to the first occurrence of type T in a Sequence.

Parameters

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

Expression semantics

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

typedef find<s,t>::type i;
Return type:

|Forward Iterator|.

Semantics:

Equivalent to

typedef find_if<s, is_same<_,t> >::type i;

Complexity

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

Example

typedef vector<char,int,unsigned,long,unsigned long> types;
typedef find<types,unsigned>::type iter;
BOOST_MPL_ASSERT(( is_same< deref<iter>::type, unsigned > ));
BOOST_MPL_ASSERT_RELATION( iter::pos::value, ==, 2 );

Docutils System Messages

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