diff --git a/include/boost/optional/detail/optional_reference_spec.hpp b/include/boost/optional/detail/optional_reference_spec.hpp index 3be3d33..4940a46 100644 --- a/include/boost/optional/detail/optional_reference_spec.hpp +++ b/include/boost/optional/detail/optional_reference_spec.hpp @@ -160,8 +160,7 @@ public: throw_exception(bad_optional_access()); } - bool operator!() const BOOST_NOEXCEPT { return ptr_ == 0; } - BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT() + explicit operator bool() const BOOST_NOEXCEPT { return ptr_ != 0; } void reset() BOOST_NOEXCEPT { ptr_ = 0; } diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 57ff8ef..72fbd60 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/test/optional_test_convert_assign.cpp b/test/optional_test_convert_assign.cpp index f0366dc..5e1ceda 100644 --- a/test/optional_test_convert_assign.cpp +++ b/test/optional_test_convert_assign.cpp @@ -25,8 +25,7 @@ struct implicit_bool_conv struct explicit_bool_conv { - bool operator!() const BOOST_NOEXCEPT { return false; } - BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT() + explicit operator bool() const BOOST_NOEXCEPT { return true; } }; template