On 6/7/12 3:04 PM, Timon Gehr wrote:
On 06/07/2012 08:34 PM, Peter Alexander wrote:

I find this very ugly. To be honest, I would be much happier without all
that mostNegative and common type stuff.
If I want to get the min
between a short and an int I'll just cast them appropriately.

The mostNegative and common type stuff is there to enable correct
semantics for taking the minimum of signed and unsigned values. Minimum
of short and int would work fine without that.

I'd much rather have a simpler standard library than a complicated one
for the
sake of a little convenience.


'min' is not complicated.

I agree. BTW Howard Hinnant's proposal N2199 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2199.html) introduces correct C++ min/max functions that take 175 lines and introduce 10 types and 12 specializations. (Proposal was rejected.) The power of min/max is about on a par with D's.

Andrei

Reply via email to