Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.2KB

  1. //
  2. // uses_executor.hpp
  3. // ~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_USES_EXECUTOR_HPP
  11. #define ASIO_USES_EXECUTOR_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/detail/type_traits.hpp"
  17. #include "asio/detail/push_options.hpp"
  18. namespace asio {
  19. /// A special type, similar to std::nothrow_t, used to disambiguate
  20. /// constructors that accept executor arguments.
  21. /**
  22. * The executor_arg_t struct is an empty structure type used as a unique type
  23. * to disambiguate constructor and function overloading. Specifically, some
  24. * types have constructors with executor_arg_t as the first argument,
  25. * immediately followed by an argument of a type that satisfies the Executor
  26. * type requirements.
  27. */
  28. struct executor_arg_t
  29. {
  30. /// Constructor.
  31. ASIO_CONSTEXPR executor_arg_t() ASIO_NOEXCEPT
  32. {
  33. }
  34. };
  35. /// A special value, similar to std::nothrow, used to disambiguate constructors
  36. /// that accept executor arguments.
  37. /**
  38. * See asio::executor_arg_t and asio::uses_executor
  39. * for more information.
  40. */
  41. #if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
  42. constexpr executor_arg_t executor_arg;
  43. #elif defined(ASIO_MSVC)
  44. __declspec(selectany) executor_arg_t executor_arg;
  45. #endif
  46. /// The uses_executor trait detects whether a type T has an associated executor
  47. /// that is convertible from type Executor.
  48. /**
  49. * Meets the BinaryTypeTrait requirements. The Asio library provides a
  50. * definition that is derived from false_type. A program may specialize this
  51. * template to derive from true_type for a user-defined type T that can be
  52. * constructed with an executor, where the first argument of a constructor has
  53. * type executor_arg_t and the second argument is convertible from type
  54. * Executor.
  55. */
  56. template <typename T, typename Executor>
  57. struct uses_executor : false_type {};
  58. } // namespace asio
  59. #include "asio/detail/pop_options.hpp"
  60. #endif // ASIO_USES_EXECUTOR_HPP