source: NonGTP/Boost/boost/spirit/fusion/sequence/io.hpp @ 857

Revision 857, 1.5 KB checked in by igarcia, 19 years ago (diff)
RevLine 
[857]1/*=============================================================================
2    Copyright (c) 1999-2003 Jaakko Järvi
3    Copyright (c) 1999-2003 Jeremiah Willcock
4    Copyright (c) 2001-2003 Joel de Guzman
5    Copyright (c) 2004 Peder Holt
6
7    Use, modification and distribution is subject to the Boost Software
8    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9    http://www.boost.org/LICENSE_1_0.txt)
10==============================================================================*/
11#if !defined(BOOST_IO_HPP)
12#define BOOST_IO_HPP
13
14#include <iostream>
15#include <boost/spirit/fusion/sequence/detail/io.hpp>
16#include <boost/spirit/fusion/sequence/as_fusion_sequence.hpp>
17
18namespace boost { namespace fusion
19{
20    ///////////////////////////////////////////////////////////////////////////
21    //
22    //  Sequence I/O (<< and >> operators)
23    //
24    ///////////////////////////////////////////////////////////////////////////
25
26    template <typename OStream, typename Sequence>
27    inline OStream&
28    operator<<(OStream& os, sequence_base<Sequence> const& seq)
29    {
30        detail::print_sequence(os,
31            as_fusion_sequence<Sequence const>::convert(seq.cast()));
32        return os;
33    }
34
35    template <typename IStream, typename Sequence>
36    inline IStream&
37    operator>>(IStream& is, sequence_base<Sequence>& seq)
38    {
39        detail::read_sequence(is,
40            as_fusion_sequence<Sequence>::convert(seq.cast()));
41        return is;
42    }
43}}
44
45#endif
Note: See TracBrowser for help on using the repository browser.