File indexing completed on 2025-01-18 09:42:39
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_MYSQL_DETAIL_SOCKET_STREAM_HPP
0009 #define BOOST_MYSQL_DETAIL_SOCKET_STREAM_HPP
0010
0011 #include <boost/asio/basic_socket.hpp>
0012 #include <boost/asio/basic_stream_socket.hpp>
0013
0014 #include <type_traits>
0015
0016 namespace boost {
0017 namespace mysql {
0018 namespace detail {
0019
0020 template <class T>
0021 struct is_socket : std::false_type
0022 {
0023 };
0024
0025
0026
0027 template <class Protocol, class Executor>
0028 struct is_socket<asio::basic_socket<Protocol, Executor>> : std::true_type
0029 {
0030 };
0031
0032 template <class Protocol, class Executor>
0033 struct is_socket<asio::basic_stream_socket<Protocol, Executor>> : std::true_type
0034 {
0035 };
0036
0037 template <class T, class = void>
0038 struct is_socket_stream : std::false_type
0039 {
0040 };
0041
0042 template <class T>
0043 struct is_socket_stream<T, typename std::enable_if<is_socket<typename T::lowest_layer_type>::value>::type>
0044 : std::true_type
0045 {
0046 };
0047
0048 }
0049 }
0050 }
0051
0052 #endif