This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.
190. min() and max() functions should be std::binary_functionsSection: 26.8.9 [alg.min.max] Status: NAD Submitter: Mark Rintoul Opened: 1999-08-26 Last modified: 2016-01-28
Priority: Not Prioritized
View other active issues in [alg.min.max].
View all other issues in [alg.min.max].
View all issues with NAD status.
Discussion:
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 std::binary_function.
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.
Rationale:
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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4