Eric Friedman wrote:
> Peter Dimov wrote:
> [snip]
>> Provide operator<. Wait six months. Collect feedback. If there is
>> evidence that operator< is evil, remove it and document why it is
>> not supplied. 
> 
> OK, I'm willing to go along with this. I'll probably also include
> operator==, with a similar plan for future evaluation.
> 
> Early evidence that operator< is evil though may be demonstrated in
> the following:
> 
>   boost::variant<int, double> var(3.0);
>   ...
>   if (var <= 3) // false

This is a potential problem, I agree. Or rather, this:

    if(var < 4)

is a potential problem.

If it causes problems in practice, we might need to add

    void operator<(variant, everything);
    void operator<(everything, variant);

to introduce ambiguities.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to