
On Wed, May 27, 2009 at 1:50 PM, Eric Friedman <ebf@users.sourceforge.net> wrote:
I think operator!= (and operator<=, operator>, operator>=) were left out for simplicity, but no good reason other than that.
The main issue I considered at the time was that I felt variant should forward to the underlying operator. That is, it should call operator!=, rather than assume operator!= is equivalent to the negation of operator==.
Maybe there's no need to be this pedantic though. Do others have an opinion?
Could this be useful in the case of something like boost::tribool as a variant type? For example: tribool a(true); tribool b(indeterminate); if ((a==b) || (a!=b)) assert(false); It would be nice if boost::variant<> with a tribool bounded type could maintain this behavior, which it seems like it would as long as operator!=() is separately forwarded. -- Matthew L. Creech