2 // is_read_buffered.hpp
3 // ~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_IS_READ_BUFFERED_HPP
12 #define BOOST_ASIO_IS_READ_BUFFERED_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/push_options.hpp>
20 #include <boost/asio/detail/push_options.hpp>
21 #include <boost/config.hpp>
22 #include <boost/asio/detail/pop_options.hpp>
24 #include <boost/asio/buffered_read_stream_fwd.hpp>
25 #include <boost/asio/buffered_stream_fwd.hpp>
32 template <typename Stream
>
33 char is_read_buffered_helper(buffered_stream
<Stream
>* s
);
35 template <typename Stream
>
36 char is_read_buffered_helper(buffered_read_stream
<Stream
>* s
);
38 struct is_read_buffered_big_type
{ char data
[10]; };
39 is_read_buffered_big_type
is_read_buffered_helper(...);
43 /// The is_read_buffered class is a traits class that may be used to determine
44 /// whether a stream type supports buffering of read data.
45 template <typename Stream
>
46 class is_read_buffered
49 #if defined(GENERATING_DOCUMENTATION)
50 /// The value member is true only if the Stream type supports buffering of
52 static const bool value
;
54 BOOST_STATIC_CONSTANT(bool,
55 value
= sizeof(detail::is_read_buffered_helper((Stream
*)0)) == 1);
62 #include <boost/asio/detail/pop_options.hpp>
64 #endif // BOOST_ASIO_IS_READ_BUFFERED_HPP