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/lib/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
16
# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
17
# define BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
21
#if defined BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
29
#include "boost/optional/optional.hpp"
30
#include "boost/utility/value_init.hpp"
35
#if defined (BOOST_NO_TEMPLATED_STREAMS)
37
inline std::ostream& operator<<(std::ostream& out, optional<T> const& v)
39
template<class CharType, class CharTrait, class T>
41
std::basic_ostream<CharType, CharTrait>&
42
operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v)
49
else out << ' ' << *v ;
55
#if defined (BOOST_NO_TEMPLATED_STREAMS)
57
inline std::istream& operator>>(std::istream& in, optional<T>& v)
59
template<class CharType, class CharTrait, class T>
61
std::basic_istream<CharType, CharTrait>&
62
operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)