std::experimental::optional operator!=
Jonathan Wakely
jwakely@redhat.com
Fri Apr 25 19:35:00 GMT 2014
On 30/03/14 12:54 +0200, Lars Gullik Bjønnes wrote:
>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?
I've committed the patch from PR 60710 (attached) and will apply it to
the 4.9 branch too.
Tested x86_64-linux.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5106 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140425/c2e2c0da/attachment.bin>
More information about the Libstdc++
mailing list