diff --git a/doc/91_relnotes.qbk b/doc/91_relnotes.qbk index ba94ef6..228760d 100644 --- a/doc/91_relnotes.qbk +++ b/doc/91_relnotes.qbk @@ -14,7 +14,7 @@ [heading Boost Release 1.66] * On newer compilers `optional` is now trivially-copyable for scalar `T`s. This uses a different storage (just `T` rather than `aligned_storage`). We require the compiler to support defaulted functions. - +* Changed the implementation of `operator==` to get rid of the `-Wmaybe-uninitialized` false-positive warning from GCC. [heading Boost Release 1.63] * Added two new in-place constructors. They work similarly to `emplace()` functions: they initialize the contained value by perfect-forwarding the obtained arguments. One constructor always initializes the contained value, the other based on a boolean condition. diff --git a/doc/html/boost_optional/relnotes.html b/doc/html/boost_optional/relnotes.html index 6cd8753..9881def 100644 --- a/doc/html/boost_optional/relnotes.html +++ b/doc/html/boost_optional/relnotes.html @@ -31,13 +31,19 @@ Boost Release 1.66 -

Boost diff --git a/doc/html/index.html b/doc/html/index.html index cad53fb..37bbc28 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -146,7 +146,7 @@ - +

Last revised: November 04, 2017 at 16:36:14 GMT

Last revised: November 04, 2017 at 18:02:17 GMT


diff --git a/include/boost/optional/detail/optional_relops.hpp b/include/boost/optional/detail/optional_relops.hpp index 3f96117..2c17f2b 100644 --- a/include/boost/optional/detail/optional_relops.hpp +++ b/include/boost/optional/detail/optional_relops.hpp @@ -26,7 +26,7 @@ namespace boost { template inline bool operator == ( optional const& x, optional const& y ) -{ return equal_pointees(x,y); } +{ return bool(x) && bool(y) ? *x == *y : bool(x) == bool(y); } template inline diff --git a/test/optional_test_maybe_uninitialized_warning.cpp b/test/optional_test_maybe_uninitialized_warning.cpp index 084834d..a9a0707 100644 --- a/test/optional_test_maybe_uninitialized_warning.cpp +++ b/test/optional_test_maybe_uninitialized_warning.cpp @@ -25,7 +25,7 @@ int main(int argc, const char *[]) if (argc > 0) b = argc; - if (a != b) + if (a == b) return 1; return 0;