rebind_executor.hpp 942 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MYSQL_DETAIL_REBIND_EXECUTOR_HPP
  8. #define BOOST_MYSQL_DETAIL_REBIND_EXECUTOR_HPP
  9. #include <boost/asio/ssl/stream.hpp>
  10. namespace boost {
  11. namespace mysql {
  12. namespace detail {
  13. // This is required because ssl::stream doesn't have a rebind_executor member type
  14. template <class Stream, class Executor>
  15. struct rebind_executor
  16. {
  17. using type = typename Stream::template rebind_executor<Executor>::other;
  18. };
  19. template <class Stream, class Executor>
  20. struct rebind_executor<boost::asio::ssl::stream<Stream>, Executor>
  21. {
  22. using type = boost::asio::ssl::stream<typename rebind_executor<Stream, Executor>::type>;
  23. };
  24. } // namespace detail
  25. } // namespace mysql
  26. } // namespace boost
  27. #endif