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.

placeholders.hpp 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // placeholders.hpp
  3. // ~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 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_PLACEHOLDERS_HPP
  11. #define ASIO_PLACEHOLDERS_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. #if defined(ASIO_HAS_BOOST_BIND)
  17. # include <boost/bind/arg.hpp>
  18. #endif // defined(ASIO_HAS_BOOST_BIND)
  19. #include "asio/detail/push_options.hpp"
  20. namespace asio {
  21. namespace placeholders {
  22. #if defined(GENERATING_DOCUMENTATION)
  23. /// An argument placeholder, for use with boost::bind(), that corresponds to
  24. /// the error argument of a handler for any of the asynchronous functions.
  25. unspecified error;
  26. /// An argument placeholder, for use with boost::bind(), that corresponds to
  27. /// the bytes_transferred argument of a handler for asynchronous functions such
  28. /// as asio::basic_stream_socket::async_write_some or
  29. /// asio::async_write.
  30. unspecified bytes_transferred;
  31. /// An argument placeholder, for use with boost::bind(), that corresponds to
  32. /// the iterator argument of a handler for asynchronous functions such as
  33. /// asio::async_connect.
  34. unspecified iterator;
  35. /// An argument placeholder, for use with boost::bind(), that corresponds to
  36. /// the results argument of a handler for asynchronous functions such as
  37. /// asio::basic_resolver::async_resolve.
  38. unspecified results;
  39. /// An argument placeholder, for use with boost::bind(), that corresponds to
  40. /// the results argument of a handler for asynchronous functions such as
  41. /// asio::async_connect.
  42. unspecified endpoint;
  43. /// An argument placeholder, for use with boost::bind(), that corresponds to
  44. /// the signal_number argument of a handler for asynchronous functions such as
  45. /// asio::signal_set::async_wait.
  46. unspecified signal_number;
  47. #elif defined(ASIO_HAS_BOOST_BIND)
  48. # if defined(__BORLANDC__) || defined(__GNUC__)
  49. inline boost::arg<1> error()
  50. {
  51. return boost::arg<1>();
  52. }
  53. inline boost::arg<2> bytes_transferred()
  54. {
  55. return boost::arg<2>();
  56. }
  57. inline boost::arg<2> iterator()
  58. {
  59. return boost::arg<2>();
  60. }
  61. inline boost::arg<2> results()
  62. {
  63. return boost::arg<2>();
  64. }
  65. inline boost::arg<2> endpoint()
  66. {
  67. return boost::arg<2>();
  68. }
  69. inline boost::arg<2> signal_number()
  70. {
  71. return boost::arg<2>();
  72. }
  73. # else
  74. namespace detail
  75. {
  76. template <int Number>
  77. struct placeholder
  78. {
  79. static boost::arg<Number>& get()
  80. {
  81. static boost::arg<Number> result;
  82. return result;
  83. }
  84. };
  85. }
  86. # if defined(ASIO_MSVC) && (ASIO_MSVC < 1400)
  87. static boost::arg<1>& error
  88. = asio::placeholders::detail::placeholder<1>::get();
  89. static boost::arg<2>& bytes_transferred
  90. = asio::placeholders::detail::placeholder<2>::get();
  91. static boost::arg<2>& iterator
  92. = asio::placeholders::detail::placeholder<2>::get();
  93. static boost::arg<2>& results
  94. = asio::placeholders::detail::placeholder<2>::get();
  95. static boost::arg<2>& endpoint
  96. = asio::placeholders::detail::placeholder<2>::get();
  97. static boost::arg<2>& signal_number
  98. = asio::placeholders::detail::placeholder<2>::get();
  99. # else
  100. namespace
  101. {
  102. boost::arg<1>& error
  103. = asio::placeholders::detail::placeholder<1>::get();
  104. boost::arg<2>& bytes_transferred
  105. = asio::placeholders::detail::placeholder<2>::get();
  106. boost::arg<2>& iterator
  107. = asio::placeholders::detail::placeholder<2>::get();
  108. boost::arg<2>& results
  109. = asio::placeholders::detail::placeholder<2>::get();
  110. boost::arg<2>& endpoint
  111. = asio::placeholders::detail::placeholder<2>::get();
  112. boost::arg<2>& signal_number
  113. = asio::placeholders::detail::placeholder<2>::get();
  114. } // namespace
  115. # endif
  116. # endif
  117. #endif
  118. } // namespace placeholders
  119. } // namespace asio
  120. #include "asio/detail/pop_options.hpp"
  121. #endif // ASIO_PLACEHOLDERS_HPP