Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

std::experimental::optional operator!=

2 views
Skip to first unread message

Lars Gullik Bjønnes

unread,
Mar 29, 2014, 10:48:29 AM3/29/14
to help-gp...@gnu.org

Hi,

When trying to convert some code using boost::optional to using
std::experimental::optional instead if come over the issue that I had to
implement operator!= for the contained types.

When looking at n3793 it states that operator!= should be implemented
with !(t1 == t2), and not t1 != t2 as the implementation in gcc 4.9 is
doing. This is the case for both the operator!= implementation where
optional<T> is compared against T.

The other operators look ok, and only operator== and operator< are used
in their implementations.

Can this be fixed before 4.9?

(changelog not done)
0001-optional-implement-operator-in-terms-of-operator.patch
0 new messages