Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

max


Algorithm

Summary

Finds and returns the maximum of a pair of values.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

None

Synopsis

#include <algorithm>
template <class T>
 const T& max(const T&, const T&);

template <class T, class Compare>
 const T& max(const T&, const T&, Compare);

Description

The max algorithm determines and returns the maximum of a pair of values. The optional argument Compare defines a comparison function that can be used in place of the default operator<.

max returns the first argument when the arguments are equal.

Example

Program Output

See Also

max_element, min, min_element



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998