Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-03-26 14:33:09


Jonathan Turkanis wrote:
>
> However, if you accept that comparisons criteria are alway contextual,
> I think you must conclude that the comparison operators <, <=, etc.
> are completely useless. On the contrary, I like the ability to have a
> default comparison criteria that works a good deal of the time;

Agree.

> as long as it's provided, it should be customizable.

Disagree. Your own logic doesn't support this conclusion: a default
comparison works most of the time, therefore, it doesn't need to be
customizable, because you could only customize it to _not work_ most of the
time.

And for the string case, the downside to encoding a comparison in the type
is that you'll now spend a lot of time converting strings (because most
libraries - correctly - accept an ordinary std::string, regardless of what
comparisons they might make underneath, or they'd expose implementation
details in the interface.)

Nobody uses anything but std::string and std::wstring. ;-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk