1 // Copyright (C) 2005, Fernando Luis Cacciola Carballal.
3 // Use, modification, and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/optional for documentation.
9 // You are welcome to contact the author at:
10 // fernando_cacciola@hotmail.com
12 #ifndef BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
13 #define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
18 #include "boost/none.hpp"
19 #include "boost/optional/optional.hpp"
25 template<class CharType, class CharTrait>
27 std::basic_ostream<CharType, CharTrait>&
28 operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t)
38 template<class CharType, class CharTrait, class T>
40 std::basic_ostream<CharType, CharTrait>&
41 operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v)
47 else out << ' ' << *v ;
53 template<class CharType, class CharTrait, class T>
55 std::basic_istream<CharType, CharTrait>&
56 operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
65 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
84 in.setstate( std::ios::failbit );