Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2006-07-18 18:29:05


On 7/11/06 10:54 AM, "Peter Dimov" <pdimov_at_[hidden]> wrote:

> Guillaume Melquiond wrote:
>
>> Back to the topic of operator< for smart_ptr, I think it was a mistake
>> for the STL to use std::less as the default parameter for ordered
>> containers. It would have been better to define some kind of
>> total_order template class (that would have defaulted to being
>> std::less).
>
> I agree that the inclusion of a separate "set/map order" relation in the
> standard library (that is defined for all standard value types) would have
> made the correct choice obvious.

Maybe the committee should have gone the other way, by not providing a
default argument for the comparison template parameter. (The "total_order"
class template wouldn't be made either.) Then there wouldn't be an
expectation that "<"/less is a blessed operation and all types must provide
it at all costs.

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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