Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

min


Algorithm

Summary

Finds and returns the minimum 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& min(const T&, const T&);

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

Description

The min algorithm determines and returns the minimum of a pair of values. In the second version of the algorithm, the optional argument Compare defines a comparison function that can be used in place of the default operator<.

min returns the first argument when the two arguments are equal.

Example

Program Output

See Also

max, max_element, 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