challenge: implement the max function

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Tue Jan 23 02:31:33 PST 2007


Donth Ave wrote:
> == Quote from Lionello Lunesu (lio at lunesu.remove.com)'s article
>> T[0]>T[1]
> To have a total ordering is also an additional requirement not present
> in the challenge.

That's a joke, right?

If not: how would you implement an efficient, generic max() function 
without using a total ordering?
You _have_ to use > [1] for that.


[1]: well, technically <, <= or >= will work as well, but it's all opCmp 
or built-in anyway, so it doesn't matter[2].
[2]: except for floating-point NaNs, those are always trouble :(.



More information about the Digitalmars-d mailing list