Given two identical boost::variant
types a
and b
, the expression ( a == b )
is permitted.
However ( a != b )
seems to be undefined. Why is this?
Given two identical boost::variant
types a
and b
, the expression ( a == b )
is permitted.
However ( a != b )
seems to be undefined. Why is this?
Because it doesn't need to.
Boost has an operators library which defines operator!= in term of operator==
I think it's just not added to the library. The Boost.Operators won't really help, because either variant would have been derived from boost::operator::equality_comparable. David Pierre is right to say you can use that, but your response is correct too, that the new operator!= won't be found by ADL, so you'll need a using operator.
I'd ask this on the boost-users mailing list.