Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2004-06-24 22:07:36

Sure, I can add the 'missing' operators. Unless anyone opposes...?


Guillaume Melquiond wrote:

> Hi,
> Looking through the documentation of Boost.Variant (both 1.31 and cvs
> versions), I see that "variant is itself LessThanComparable if and only
> if every one of its bounded types meets the requirements of the
> concept". The documentation directly hyper-links to the concept part of
> Boost and this concept description explains that "LessThanComparable
> types must have <, >, <=, and >= operators".
> Unfortunately, boost::variant implementation only defines operator<. So
> here we have a contradiction between the implementation and the
> interface. The same kind of problem arises with operator!= and the
> EqualityComparable concept.
> I am not sure what the best solution is:
> - define the missing operators in boost::variant,
> - remove any reference to LessThanComparable and EqualityComparable
> concepts from boost::variant documentation,
> - correct the concepts so they only speak about operator< and
> operator==.
> The last solution corresponds to the way the concepts are defined in the
> [lib.utilities] part of the C++ standard. But I would rather see the
> missing operators defined in boost::variant if possible.
> Regards,
> Guillaume

Boost list run by bdawes at, gregod at, cpdaniel at, john at