Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:10

0001 //
0002 // is_write_buffered.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_IS_WRITE_BUFFERED_HPP
0012 #define BOOST_ASIO_IS_WRITE_BUFFERED_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/buffered_stream_fwd.hpp>
0020 #include <boost/asio/buffered_write_stream_fwd.hpp>
0021 
0022 #include <boost/asio/detail/push_options.hpp>
0023 
0024 namespace boost {
0025 namespace asio {
0026 
0027 namespace detail {
0028 
0029 template <typename Stream>
0030 char is_write_buffered_helper(buffered_stream<Stream>* s);
0031 
0032 template <typename Stream>
0033 char is_write_buffered_helper(buffered_write_stream<Stream>* s);
0034 
0035 struct is_write_buffered_big_type { char data[10]; };
0036 is_write_buffered_big_type is_write_buffered_helper(...);
0037 
0038 } // namespace detail
0039 
0040 /// The is_write_buffered class is a traits class that may be used to determine
0041 /// whether a stream type supports buffering of written data.
0042 template <typename Stream>
0043 class is_write_buffered
0044 {
0045 public:
0046 #if defined(GENERATING_DOCUMENTATION)
0047   /// The value member is true only if the Stream type supports buffering of
0048   /// written data.
0049   static const bool value;
0050 #else
0051   BOOST_ASIO_STATIC_CONSTANT(bool,
0052       value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
0053 #endif
0054 };
0055 
0056 } // namespace asio
0057 } // namespace boost
0058 
0059 #include <boost/asio/detail/pop_options.hpp>
0060 
0061 #endif // BOOST_ASIO_IS_WRITE_BUFFERED_HPP