fix doc example typo
[boost.git] / boost / asio / is_read_buffered.hpp
blob92dcc9627d44f2c6edd4de36c97c59a74b7d892d
1 //
2 // is_read_buffered.hpp
3 // ~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
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)
9 //
11 #ifndef BOOST_ASIO_IS_READ_BUFFERED_HPP
12 #define BOOST_ASIO_IS_READ_BUFFERED_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
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>
27 namespace boost {
28 namespace asio {
30 namespace detail {
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(...);
41 } // namespace detail
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
48 public:
49 #if defined(GENERATING_DOCUMENTATION)
50 /// The value member is true only if the Stream type supports buffering of
51 /// read data.
52 static const bool value;
53 #else
54 BOOST_STATIC_CONSTANT(bool,
55 value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1);
56 #endif
59 } // namespace asio
60 } // namespace boost
62 #include <boost/asio/detail/pop_options.hpp>
64 #endif // BOOST_ASIO_IS_READ_BUFFERED_HPP