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 ASIO_IS_READ_BUFFERED_HPP
12
#define ASIO_IS_READ_BUFFERED_HPP
14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
16
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18
#include "asio/detail/push_options.hpp"
20
#include "asio/detail/push_options.hpp"
21
#include <boost/config.hpp>
22
#include "asio/detail/pop_options.hpp"
24
#include "asio/buffered_read_stream_fwd.hpp"
25
#include "asio/buffered_stream_fwd.hpp"
31
template <typename Stream>
32
char is_read_buffered_helper(buffered_stream<Stream>* s);
34
template <typename Stream>
35
char is_read_buffered_helper(buffered_read_stream<Stream>* s);
37
struct is_read_buffered_big_type { char data[10]; };
38
is_read_buffered_big_type is_read_buffered_helper(...);
42
/// The is_read_buffered class is a traits class that may be used to determine
43
/// whether a stream type supports buffering of read data.
44
template <typename Stream>
45
class is_read_buffered
48
#if defined(GENERATING_DOCUMENTATION)
49
/// The value member is true only if the Stream type supports buffering of
51
static const bool value;
53
BOOST_STATIC_CONSTANT(bool,
54
value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1);
60
#include "asio/detail/pop_options.hpp"
62
#endif // ASIO_IS_READ_BUFFERED_HPP