19 Feb
2009
19 Feb
'09
11:45 a.m.
Hello, I've just noticed that the following code might be missleading: boost::optional<int> opt; opt = 0; std::cout << opt; If boost/optional/optional_io.hpp is not included, the above code outputs "1" - because boost::optional is implicitly convertible to bool. Maybe it's worth either including boost/optional/optional_io.hpp in boost/optional.hpp or making some trick to generate compiler error if operator <<() used and optional_io.hpp is not included?