Chris@16: // Chris@16: // is_read_buffered.hpp Chris@16: // ~~~~~~~~~~~~~~~~~~~~ Chris@16: // Chris@101: // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #ifndef BOOST_ASIO_IS_READ_BUFFERED_HPP Chris@16: #define BOOST_ASIO_IS_READ_BUFFERED_HPP Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: # pragma once Chris@16: #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace asio { Chris@16: Chris@16: namespace detail { Chris@16: Chris@16: template Chris@16: char is_read_buffered_helper(buffered_stream* s); Chris@16: Chris@16: template Chris@16: char is_read_buffered_helper(buffered_read_stream* s); Chris@16: Chris@16: struct is_read_buffered_big_type { char data[10]; }; Chris@16: is_read_buffered_big_type is_read_buffered_helper(...); Chris@16: Chris@16: } // namespace detail Chris@16: Chris@16: /// The is_read_buffered class is a traits class that may be used to determine Chris@16: /// whether a stream type supports buffering of read data. Chris@16: template Chris@16: class is_read_buffered Chris@16: { Chris@16: public: Chris@16: #if defined(GENERATING_DOCUMENTATION) Chris@16: /// The value member is true only if the Stream type supports buffering of Chris@16: /// read data. Chris@16: static const bool value; Chris@16: #else Chris@16: BOOST_ASIO_STATIC_CONSTANT(bool, Chris@16: value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1); Chris@16: #endif Chris@16: }; Chris@16: Chris@16: } // namespace asio Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_ASIO_IS_READ_BUFFERED_HPP