  Click here to view the latest version of this page.  Header
<boost/algorithm/minmax.hpp>  Function templates description
Requirements on types Note about performance   The minmax
library is composed of two headers, <boost/algorithm/minmax.hpp>
and <boost/algorithm/minmax_element.hpp>. (See rationale.) The
problem solved by this library is that simultaneous min and max
computation requires only one comparison, but using std::min and
std::max forces two comparisons. Worse, to compute the minimum
and maximum elements of a range of n elements requires only
3n/2+1 comparisons, instead of the 2n (in two passes) forced by
std::min_element and std::max_element. I always thought it is a
waste to have to call two functions to compute the extent of a
range, performing two passes over the input, when one should be
enough. The present library solves both problems.  The first
file implements the function templates minmax as straightforward
extensions of the C++ standard. As it returns a pair of const&,
we must use the Bo