|
Boost : |
From: Martin Bonner (martin.bonner_at_[hidden])
Date: 2006-07-11 06:33:52
----Original Message----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov Sent:
11 July 2006 11:18 To: boost_at_[hidden]
Subject: Re: [boost] Please don't define a fake "operator <" justfor
orderedcontainers
> Daryle Walker wrote:
>
>> [1] If you make a fake order for "std::complex<>", would you compare
>> real components then imaginary components, or would you use magnitude
>> then angle?
>
> Real, then imaginary. Compare with:
Interesting. I would have chosen magnitude and then angle. Why components.
>
> "If you make a FAKE order for std::string, would you compare left to
> right or right to left?"
I don't think that is a legitimate comparison. In my world view, strings have a natural order but complex numbers don't. Now admittedly, operator <() for std::string doesn't actually correspond to my natural ordering (Zoë should be less than Zoo, but it isn't), but it is close enough for most purposes and much cheaper than a locale sensitive comparison.
-- Martin Bonner Martin.Bonner_at_[hidden] Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk