Name
min function template — Returns the minimum of two values
Synopsis
template<typename T> const T& min(const T& a, const T& b); template<typename T, typename Compare> const T& min(const T& a, const T& b, Compare comp);
The min
function template
returns the smaller of a
and
b
. If neither is smaller, it
returns a
.
The first form compares values using the <
operator. The second form calls
comp(a
, b)
.
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.