id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2103,ostream::operator<<(bool) is called if optional_io.hpp is not included,nasonov,Fernando Cacciola,"If you pass an optional value to ostream, it would print a result of safe_bool() if is not included. {{{ $ cat -n unspecified_bool_type.cpp 1 #include 2 #include 3 4 boost::optional o('o'); 5 6 void without_io() 7 { 8 std::cout << o << '\n'; 9 } 10 11 #include 12 13 void with_io() 14 { 15 std::cout << o << '\n'; 16 } 17 18 int main() 19 { 20 without_io(); 21 with_io(); 22 } $ ./a.out 1 o }}} This can be fixed by a adding forward declaration of operator<< to optional_fwd.hpp. Note that other uses of unspecified_bool_type may be buggy. ",Bugs,closed,Boost 1.36.0,optional,Boost 1.35.0,Problem,fixed,,