2 // is_write_buffered.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2022 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_WRITE_BUFFERED_HPP
12 #define BOOST_ASIO_IS_WRITE_BUFFERED_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/buffered_stream_fwd.hpp>
20 #include <boost/asio/buffered_write_stream_fwd.hpp>
22 #include <boost/asio/detail/push_options.hpp>
29 template <typename Stream>
30 char is_write_buffered_helper(buffered_stream<Stream>* s);
32 template <typename Stream>
33 char is_write_buffered_helper(buffered_write_stream<Stream>* s);
35 struct is_write_buffered_big_type { char data[10]; };
36 is_write_buffered_big_type is_write_buffered_helper(...);
40 /// The is_write_buffered class is a traits class that may be used to determine
41 /// whether a stream type supports buffering of written data.
42 template <typename Stream>
43 class is_write_buffered
46 #if defined(GENERATING_DOCUMENTATION)
47 /// The value member is true only if the Stream type supports buffering of
49 static const bool value;
51 BOOST_ASIO_STATIC_CONSTANT(bool,
52 value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
59 #include <boost/asio/detail/pop_options.hpp>
61 #endif // BOOST_ASIO_IS_WRITE_BUFFERED_HPP