min [C++ Reference]
Keywords: stl,algorithm,min
Date: 2008-10-14T15:42:05-0700

[[min]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## 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: max, max_element, min_element

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •