source: NonGTP/Boost/boost/iostreams/input_sequence.hpp @ 857

Revision 857, 1.9 KB checked in by igarcia, 19 years ago (diff)
RevLine 
[857]1// (C) Copyright Jonathan Turkanis 2003.
2// Distributed under the Boost Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
4
5// See http://www.boost.org/libs/iostreams for documentation.
6
7#ifndef BOOST_IOSTREAMS_INPUT_SEQUENCE_HPP_INCLUDED
8#define BOOST_IOSTREAMS_INPUT_SEQUENCE_HPP_INCLUDED
9
10#if defined(_MSC_VER) && (_MSC_VER >= 1020)
11# pragma once
12#endif
13
14#include <utility>           // pair.
15#include <boost/config.hpp>  // DEDUCED_TYPENAME, MSVC.
16#include <boost/detail/workaround.hpp>
17#include <boost/iostreams/detail/wrap_unwrap.hpp>
18#include <boost/iostreams/traits.hpp>
19#include <boost/mpl/if.hpp>
20
21// Must come last.
22#include <boost/iostreams/detail/config/disable_warnings.hpp>
23
24namespace boost { namespace iostreams {
25
26namespace detail {
27
28template<typename T>
29struct input_sequence_impl;
30
31} // End namespace detail.
32
33template<typename T>
34inline std::pair<
35    BOOST_DEDUCED_TYPENAME char_type_of<T>::type*,
36    BOOST_DEDUCED_TYPENAME char_type_of<T>::type*
37>
38input_sequence(T& t)
39{ return detail::input_sequence_impl<T>::input_sequence(t); }
40
41namespace detail {
42
43//------------------Definition of direct_impl-------------------------------//
44
45template<typename T>
46struct input_sequence_impl
47    : mpl::if_<
48          detail::is_custom<T>,
49          operations<T>,
50          input_sequence_impl<direct_tag>
51      >::type
52    { };
53
54template<>
55struct input_sequence_impl<direct_tag> {
56    template<typename U>
57    static std::pair<
58        BOOST_DEDUCED_TYPENAME char_type_of<U>::type*,
59        BOOST_DEDUCED_TYPENAME char_type_of<U>::type*
60    >
61    input_sequence(U& u) { return u.input_sequence(); }
62};
63
64} // End namespace detail.
65
66} } // End namespaces iostreams, boost.
67
68#include <boost/iostreams/detail/config/enable_warnings.hpp>
69
70#endif // #ifndef BOOST_IOSTREAMS_INPUT_SEQUENCE_HPP_INCLUDED
Note: See TracBrowser for help on using the repository browser.