Title
min() and max() functions should be std::binary_functions
Status
nad
Section
[alg.min.max]
Submitter
Mark Rintoul

Created on 1999-08-26.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

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.

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt ]

C++0x has lambdas to address this problem now.

Moved to NAD.

Date: 2010-10-21.18:28:33

[ post Bellevue: Alisdair requested to re-Open. ]

Date: 1999-08-26.00:00:00

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.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1809
2010-10-21 18:28:33adminsetmessages: + msg1808
2010-10-21 18:28:33adminsetmessages: + msg1807
1999-08-26 00:00:00admincreate