3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/max-element.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Querying Algorithms / max_element |
template<
typename Sequence
, typename Pred =[less](./less.html)<[\_1](./placeholders.html),[\_2](./placeholders.html)>
>
struct[max\_element](./max-element.html){
typedef_unspecified_type;
};
Returns an iterator to the largest element in Sequence.
#include <[boost/mpl/max\_element.hpp](../../../../boost/mpl/max_element.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence | A sequence to be searched. |
| Pred | Binary Lambda Expression | A comparison criteria. |
For any Forward Sequence s and binary Lambda Expression pred:
typedef[max\_element](./max-element.html)<s,pred>::type i;
| Return type: |
| | Semantics: |
i is the first iterator in [begin<s>::type, end<s>::type) such that for every iterator j in [begin<s>::type, end<s>::type),
[apply](./apply.html)< pred,[deref](./deref.html)<i>::type,[deref](./deref.html)<j>::type >::type::value == false
|
Linear. Zero comparisons if s is empty, otherwise exactly size<s>::value - 1 comparisons.
typedef[vector](./vector.html)<bool,char[50],long,double> types;
typedef[max\_element](./max-element.html)<[transform\_view](./transform-view.html)< types,[sizeof\_](./sizeof.html)<[\_1](./placeholders.html)> >
>::type iter;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[deref](./deref.html)<iter::base>::type, char[50]> ));
Querying Algorithms, min_element, find_if, upper_bound, find
| 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) |