Section: 28.7.8 [alg.min.max] Status: NAD Submitter: Mark Rintoul Opened: 1999-08-26 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [alg.min.max].
View all issues with NAD status.
Both std::min and std::max are defined as template functions. This
is very different than the definition of std::plus (and similar
structs) which are defined as function objects which inherit
This lack of inheritance leaves std::min and std::max somewhat useless in standard library algorithms which require a function object that inherits std::binary_function.
[ post Bellevue: Alisdair requested to re-Open. ]
[ 2009-07 Frankfurt ]
C++0x has lambdas to address this problem now.
Moved to NAD.
Although perhaps an unfortunate design decision, the omission is not a defect in the current standard. A future standard may wish to consider additional function objects.