
On 7/11/06 10:54 AM, "Peter Dimov" <pdimov@mmltd.net> 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