1 .. Algorithms/Querying Algorithms//max_element |90
13 , typename Pred = less<_1,_2>
17 typedef |unspecified| type;
25 Returns an iterator to the largest element in ``Sequence``.
33 #include <boost/mpl/max_element.hpp>
39 +---------------+-------------------------------+-----------------------------------+
40 | Parameter | Requirement | Description |
41 +===============+===============================+===================================+
42 |``Sequence`` | |Forward Sequence| | A sequence to be searched. |
43 +---------------+-------------------------------+-----------------------------------+
44 | ``Pred`` | Binary |Lambda Expression| | A comparison criteria. |
45 +---------------+-------------------------------+-----------------------------------+
52 For any |Forward Sequence| ``s`` and binary |Lambda Expression| ``pred``:
57 typedef max_element<s,pred>::type i;
63 ``i`` is the first iterator in |begin/end<s>| such that for every iterator ``j``
68 apply< pred, deref<i>::type, deref<j>::type >::type::value == false
74 Linear. Zero comparisons if ``s`` is empty, otherwise exactly ``size<s>::value - 1``
83 typedef vector<bool,char[50],long,double> types;
85 transform_view< types,sizeof_<_1> >
88 BOOST_MPL_ASSERT(( is_same< deref<iter::base>::type, char[50]> ));
94 |Querying Algorithms|, |min_element|, |find_if|, |upper_bound|, |find|
97 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
98 Distributed under the Boost Software License, Version 1.0. (See accompanying
99 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)