diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index f059e2e..9def94e 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -1271,9 +1271,10 @@ get_pointer ( optional& opt ) // The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header. template std::basic_ostream& -operator<<(std::basic_ostream&, optional_detail::optional_tag const&) +operator<<(std::basic_ostream& os, optional_detail::optional_tag const&) { - BOOST_STATIC_ASSERT_MSG(sizeof(CharType) == 0, "If you want to output boost::optional, include header "); + BOOST_STATIC_ASSERT_MSG(sizeof(CharType) == 0, "If you want to output boost::optional, include header "); + return os; } // optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).