min

C/C++ Reference

min
Syntax:
  #include <algorithm>
  const TYPE& min( const TYPE& x, const TYPE& y );
  const TYPE& min( const TYPE& x, const TYPE& y, BinPred p );

The min() function, unsurprisingly, returns the smaller of x and y.

By default, the < operator is used to compare the two elements. If the binary predicate p is given, it will be used instead.

Related topics: