
----Original Message---- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Peter Dimov Sent: 11 July 2006 11:18 To: boost@lists.boost.org 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@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894