3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/find-if.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Querying Algorithms / find_if |
template<
typename Sequence
, typename Pred
>
struct[find\_if](./find-if.html){
typedef_unspecified_type;
};
Returns an iterator to the first element in Sequence that satisfies the predicate Pred.
#include <[boost/mpl/find\_if.hpp](../../../../boost/mpl/find_if.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence | A sequence to search in. |
| Pred | Unary Lambda Expression | A search condition. |
For any Forward Sequence s and unary Lambda Expression pred:
typedef[find\_if](./find-if.html)<s,pred>::type i;
| Return type: |
| | Semantics: |
i is the first iterator in the range [begin<s>::type, end<s>::type) such that
[apply](./apply.html)< pred,[deref](./deref.html)<i>::type >::type::value == true
If no such iterator exists, i is identical to end<s>::type.
|
Linear. At most size<s>::value applications of pred.
typedef[vector](./vector.html)<char,int,unsigned,long,unsigned long> types;
typedef[find\_if](./find-if.html)<types, is_same<[\_1](./placeholders.html),unsigned> >::type iter;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[deref](./deref.html)<iter>::type, unsigned > ));[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)( iter::pos::value, ==, 2 );
Querying Algorithms, find, count_if, lower_bound
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |