mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
Use BOOST_EXPLICIT_OPERATOR_BOOL for optional
I often have the problem that when I change a std::wstring to boost::optional<std::wstring> and the variable is used as a parameter with Boost.Format, the result silently changes from the string contents to "1". This change prevents implicit conversion to bool if the compiler supports explicit conversion operators.
This commit is contained in:
committed by
Andrzej Krzemienski
parent
b4738ac07e
commit
c7cf80e5df
@ -29,5 +29,6 @@ import testing ;
|
||||
[ compile-fail optional_test_ref_fail4.cpp ]
|
||||
[ compile-fail optional_test_inplace_fail.cpp ]
|
||||
[ compile-fail optional_test_inplace_fail2.cpp ]
|
||||
[ compile-fail optional_test_fail_implicit_bool_convert.cpp ]
|
||||
;
|
||||
}
|
||||
|
Reference in New Issue
Block a user