summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/include/asio/impl/detached.hpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/include/asio/impl/detached.hpp')
-rw-r--r--3rdparty/asio/include/asio/impl/detached.hpp63
1 files changed, 5 insertions, 58 deletions
diff --git a/3rdparty/asio/include/asio/impl/detached.hpp b/3rdparty/asio/include/asio/impl/detached.hpp
index f159b1ffbaa..774e52b1e01 100644
--- a/3rdparty/asio/include/asio/impl/detached.hpp
+++ b/3rdparty/asio/include/asio/impl/detached.hpp
@@ -2,7 +2,7 @@
// impl/detached.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,6 @@
#include "asio/detail/config.hpp"
#include "asio/async_result.hpp"
-#include "asio/detail/variadic_templates.hpp"
#include "asio/detail/push_options.hpp"
@@ -34,29 +33,10 @@ namespace detail {
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename... Args>
void operator()(Args...)
{
}
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- void operator()()
- {
- }
-
-#define ASIO_PRIVATE_DETACHED_DEF(n) \
- template <ASIO_VARIADIC_TPARAMS(n)> \
- void operator()(ASIO_VARIADIC_TARGS(n)) \
- { \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_DETACHED_DEF)
-#undef ASIO_PRIVATE_DETACHED_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
} // namespace detail
@@ -78,47 +58,14 @@ struct async_result<detached_t, Signature>
{
}
-#if defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
template <typename Initiation, typename RawCompletionToken, typename... Args>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken),
- ASIO_MOVE_ARG(Args)... args)
+ static return_type initiate(Initiation&& initiation,
+ RawCompletionToken&&, Args&&... args)
{
- ASIO_MOVE_CAST(Initiation)(initiation)(
+ static_cast<Initiation&&>(initiation)(
detail::detached_handler(detached_t()),
- ASIO_MOVE_CAST(Args)(args)...);
- }
-
-#else // defined(ASIO_HAS_VARIADIC_TEMPLATES)
-
- template <typename Initiation, typename RawCompletionToken>
- static return_type initiate(
- ASIO_MOVE_ARG(Initiation) initiation,
- ASIO_MOVE_ARG(RawCompletionToken))
- {
- ASIO_MOVE_CAST(Initiation)(initiation)(
- detail::detached_handler(detached_t()));
+ static_cast<Args&&>(args)...);
}
-
-#define ASIO_PRIVATE_INITIATE_DEF(n) \
- template <typename Initiation, typename RawCompletionToken, \
- ASIO_VARIADIC_TPARAMS(n)> \
- static return_type initiate( \
- ASIO_MOVE_ARG(Initiation) initiation, \
- ASIO_MOVE_ARG(RawCompletionToken), \
- ASIO_VARIADIC_MOVE_PARAMS(n)) \
- { \
- ASIO_MOVE_CAST(Initiation)(initiation)( \
- detail::detached_handler(detached_t()), \
- ASIO_VARIADIC_MOVE_ARGS(n)); \
- } \
- /**/
- ASIO_VARIADIC_GENERATE(ASIO_PRIVATE_INITIATE_DEF)
-#undef ASIO_PRIVATE_INITIATE_DEF
-
-#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
};
#endif // !defined(GENERATING_DOCUMENTATION)