is_terminal_cancel.hpp 673 B

1234567891011121314151617181920212223
  1. //
  2. // Copyright (c) 2025 Marcelo Zimbres Silva (mzimbres@gmail.com),
  3. // Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. #ifndef BOOST_REDIS_IS_TERMINAL_CANCEL_HPP
  9. #define BOOST_REDIS_IS_TERMINAL_CANCEL_HPP
  10. #include <boost/asio/cancellation_type.hpp>
  11. namespace boost::redis::detail {
  12. constexpr bool is_terminal_cancel(asio::cancellation_type_t cancel_state)
  13. {
  14. return (cancel_state & asio::cancellation_type_t::terminal) != asio::cancellation_type_t::none;
  15. }
  16. } // namespace boost::redis::detail
  17. #endif