12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef BOOST_MYSQL_DETAIL_SOCKET_STREAM_HPP
- #define BOOST_MYSQL_DETAIL_SOCKET_STREAM_HPP
- #include <boost/asio/basic_socket.hpp>
- #include <boost/asio/basic_stream_socket.hpp>
- #include <type_traits>
- namespace boost {
- namespace mysql {
- namespace detail {
- template <class T>
- struct is_socket : std::false_type
- {
- };
- template <class Protocol, class Executor>
- struct is_socket<asio::basic_socket<Protocol, Executor>> : std::true_type
- {
- };
- template <class Protocol, class Executor>
- struct is_socket<asio::basic_stream_socket<Protocol, Executor>> : std::true_type
- {
- };
- template <class T, class = void>
- struct is_socket_stream : std::false_type
- {
- };
- template <class T>
- struct is_socket_stream<T, typename std::enable_if<is_socket<typename T::lowest_layer_type>::value>::type>
- : std::true_type
- {
- };
- }
- }
- }
- #endif
|