diff --git a/Jamroot b/Jamroot
index bf05265f80f255dedb0b9d0df57b66698fcc3773..cc82d03ffcaba0cbcfe5bcd43c8521cce6a3452d 100644
--- a/Jamroot
+++ b/Jamroot
@@ -144,7 +144,7 @@ import option ;
import tools/boost\_install/boost-install ;
path-constant BOOST_ROOT : . ;
-constant BOOST_VERSION : 1.76.0 ;
+constant BOOST_VERSION : 1.79.0 ;
constant BOOST_JAMROOT_MODULE : $(__name__) ;
# Allow subprojects to simply `import config : requires ;` to get access to the requires rule
@@ -213,18 +213,15 @@ rule handle-static-runtime ( properties * )
# dangerous on Windows. Therefore, we disallow it. This might be drastic,
# but it was disabled for a while without anybody complaining.
- # For CW, static runtime is needed so that std::locale works.
- if shared in $(properties) && static in $(properties) &&
- ! ( cw in $(properties) )
- {
- if ! $(.shared-static-warning-emitted)
- {
- ECHO "warning: skipping configuration link=shared, runtime-link=static" ;
- ECHO "warning: this combination is either impossible or too dangerous" ;
- ECHO "warning: to be of any use" ;
- .shared-static-warning-emitted = 1 ;
- }
+ local argv = [ modules.peek : ARGV ] ;
+ if shared in $(properties)
+ && static in $(properties)
+ # For CW, static runtime is needed so that std::locale works.
+ && ! ( cw in $(properties) )
+ && ! --allow-shared-static in $(argv)
+ {
+ boostcpp.emit-shared-static-warning ;
return no ;
}
}
diff --git a/README.OpenSource b/README.OpenSource
index 36dd2a28375c8713e329a7c68ad19c024d3c83ea..8c1e7c28c929372f64f168ce30b7728c0fe77c4d 100644
--- a/README.OpenSource
+++ b/README.OpenSource
@@ -3,7 +3,7 @@
"Name": "Boost",
"License": "Boost Software License V1.0",
"License File": "LICENSE_1_0.txt",
- "Version Number": "1.76.0",
+ "Version Number": "1.79.0",
"Owner": "wangyongjun7@huawei.com",
"Upstream URL": "http://www.boost.org/",
"Description": "Boost provides free portable peer-reviewed C++ libraries. The emphasis is on portable libraries which work well with the C++ Standard Library. See http://www.boost.org"
diff --git a/boost/asio.hpp b/boost/asio.hpp
index 362f721792d95aec97e1636fe18f09fe2ed25c88..a1c1c378eb6d5d5fe9d98273c92f0f01e15a7f08 100644
--- a/boost/asio.hpp
+++ b/boost/asio.hpp
@@ -2,7 +2,7 @@
// asio.hpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
@@ -19,12 +19,17 @@
#include
#include
+#include
+#include
#include
#include
#include
#include
+#include
#include
+#include
#include
+#include
#include
#include
#include
@@ -32,11 +37,16 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
+#include
+#include
#include
#include
+#include
#include
#include
#include
@@ -44,10 +54,14 @@
#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -85,6 +99,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -141,10 +156,14 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
+#include
#include
+#include
#include
#include
#include
@@ -154,6 +173,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -175,6 +195,7 @@
#include
#include
#include
+#include
#include
#include
diff --git a/boost/asio/any_io_executor.hpp b/boost/asio/any_io_executor.hpp
index 8eb3d724bd04a7f587a3dfde68c81dfe5c0beee4..6dc8731fdcaee0b5b16afa21d0d57a7bd66ec023 100644
--- a/boost/asio/any_io_executor.hpp
+++ b/boost/asio/any_io_executor.hpp
@@ -2,7 +2,7 @@
// any_io_executor.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
@@ -88,29 +88,17 @@ public:
#endif // !defined(GENERATING_DOCUMENTATION)
/// Default constructor.
- any_io_executor() BOOST_ASIO_NOEXCEPT
- : base_type()
- {
- }
+ BOOST_ASIO_DECL any_io_executor() BOOST_ASIO_NOEXCEPT;
/// Construct in an empty state. Equivalent effects to default constructor.
- any_io_executor(nullptr_t) BOOST_ASIO_NOEXCEPT
- : base_type(nullptr_t())
- {
- }
+ BOOST_ASIO_DECL any_io_executor(nullptr_t) BOOST_ASIO_NOEXCEPT;
/// Copy constructor.
- any_io_executor(const any_io_executor& e) BOOST_ASIO_NOEXCEPT
- : base_type(static_cast(e))
- {
- }
+ BOOST_ASIO_DECL any_io_executor(const any_io_executor& e) BOOST_ASIO_NOEXCEPT;
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move constructor.
- any_io_executor(any_io_executor&& e) BOOST_ASIO_NOEXCEPT
- : base_type(static_cast(e))
- {
- }
+ BOOST_ASIO_DECL any_io_executor(any_io_executor&& e) BOOST_ASIO_NOEXCEPT;
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Construct to point to the same target as another any_executor.
@@ -159,38 +147,23 @@ public:
#endif // defined(GENERATING_DOCUMENTATION)
/// Assignment operator.
- any_io_executor& operator=(const any_io_executor& e) BOOST_ASIO_NOEXCEPT
- {
- base_type::operator=(static_cast(e));
- return *this;
- }
+ BOOST_ASIO_DECL any_io_executor& operator=(
+ const any_io_executor& e) BOOST_ASIO_NOEXCEPT;
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move assignment operator.
- any_io_executor& operator=(any_io_executor&& e) BOOST_ASIO_NOEXCEPT
- {
- base_type::operator=(static_cast(e));
- return *this;
- }
+ BOOST_ASIO_DECL any_io_executor& operator=(
+ any_io_executor&& e) BOOST_ASIO_NOEXCEPT;
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Assignment operator that sets the polymorphic wrapper to the empty state.
- any_io_executor& operator=(nullptr_t)
- {
- base_type::operator=(nullptr_t());
- return *this;
- }
+ BOOST_ASIO_DECL any_io_executor& operator=(nullptr_t);
/// Destructor.
- ~any_io_executor()
- {
- }
+ BOOST_ASIO_DECL ~any_io_executor();
/// Swap targets with another polymorphic wrapper.
- void swap(any_io_executor& other) BOOST_ASIO_NOEXCEPT
- {
- static_cast(*this).swap(static_cast(other));
- }
+ BOOST_ASIO_DECL void swap(any_io_executor& other) BOOST_ASIO_NOEXCEPT;
/// Obtain a polymorphic wrapper with the specified property.
/**
@@ -231,6 +204,30 @@ public:
#if !defined(GENERATING_DOCUMENTATION)
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::require(
+ const execution::blocking_t::never_t&, int) const;
+
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::blocking_t::possibly_t&, int) const;
+
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::tracked_t&, int) const;
+
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::outstanding_work_t::untracked_t&, int) const;
+
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::fork_t&, int) const;
+
+template <>
+BOOST_ASIO_DECL any_io_executor any_io_executor::prefer(
+ const execution::relationship_t::continuation_t&, int) const;
+
namespace traits {
#if !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
@@ -299,4 +296,10 @@ struct prefer_member :
#include
+#if defined(BOOST_ASIO_HEADER_ONLY) \
+ && !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+# include
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+ // && !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
#endif // BOOST_ASIO_ANY_IO_EXECUTOR_HPP
diff --git a/boost/asio/associated_allocator.hpp b/boost/asio/associated_allocator.hpp
index 76e8a9b88307a8908077253b296afdc8b436b79b..01c020269b72dfcccb2d62d8347bf62e7687444c 100644
--- a/boost/asio/associated_allocator.hpp
+++ b/boost/asio/associated_allocator.hpp
@@ -2,7 +2,7 @@
// associated_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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,15 +17,33 @@
#include
#include
+#include
+#include
#include
#include
namespace boost {
namespace asio {
+
+template
+struct associated_allocator;
+
namespace detail {
-template
+template
+struct has_allocator_type : false_type
+{
+};
+
+template
+struct has_allocator_type::type>
+ : true_type
+{
+};
+
+template
struct associated_allocator_impl
{
typedef E type;
@@ -48,6 +66,17 @@ struct associated_allocator_impl
+struct associated_allocator_impl::value
+ >::type,
+ typename void_type<
+ typename associator::type
+ >::type> : associator
+{
+};
+
} // namespace detail
/// Traits type used to obtain the allocator associated with an object.
@@ -94,7 +123,7 @@ struct associated_allocator
* @returns associated_allocator::get(t)
*/
template
-inline typename associated_allocator::type
+BOOST_ASIO_NODISCARD inline typename associated_allocator::type
get_associated_allocator(const T& t) BOOST_ASIO_NOEXCEPT
{
return associated_allocator::get(t);
@@ -105,7 +134,7 @@ get_associated_allocator(const T& t) BOOST_ASIO_NOEXCEPT
* @returns associated_allocator::get(t, a)
*/
template
-inline typename associated_allocator::type
+BOOST_ASIO_NODISCARD inline typename associated_allocator::type
get_associated_allocator(const T& t, const Allocator& a) BOOST_ASIO_NOEXCEPT
{
return associated_allocator::get(t, a);
@@ -119,6 +148,29 @@ using associated_allocator_t
#endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
+#if defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER) \
+ || defined(GENERATING_DOCUMENTATION)
+
+/// Specialisation of associated_allocator for @c std::reference_wrapper.
+template
+struct associated_allocator, Allocator>
+{
+ /// Forwards @c type to the associator specialisation for the unwrapped type
+ /// @c T.
+ typedef typename associated_allocator::type type;
+
+ /// Forwards the request to get the allocator to the associator specialisation
+ /// for the unwrapped type @c T.
+ static type get(reference_wrapper t,
+ const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT
+ {
+ return associated_allocator::get(t.get(), a);
+ }
+};
+
+#endif // defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER)
+ // || defined(GENERATING_DOCUMENTATION)
+
} // namespace asio
} // namespace boost
diff --git a/boost/asio/associated_cancellation_slot.hpp b/boost/asio/associated_cancellation_slot.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..f3f52e733721aa904c82321222bc51b71b58b20c
--- /dev/null
+++ b/boost/asio/associated_cancellation_slot.hpp
@@ -0,0 +1,180 @@
+//
+// associated_cancellation_slot.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2022 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)
+//
+
+#ifndef BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP
+#define BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include
+#include
+#include
+#include
+
+#include
+
+namespace boost {
+namespace asio {
+
+template
+struct associated_cancellation_slot;
+
+namespace detail {
+
+template
+struct has_cancellation_slot_type : false_type
+{
+};
+
+template
+struct has_cancellation_slot_type::type>
+ : true_type
+{
+};
+
+template
+struct associated_cancellation_slot_impl
+{
+ typedef void asio_associated_cancellation_slot_is_unspecialised;
+
+ typedef S type;
+
+ static type get(const T&, const S& s = S()) BOOST_ASIO_NOEXCEPT
+ {
+ return s;
+ }
+};
+
+template
+struct associated_cancellation_slot_impl::type>
+{
+ typedef typename T::cancellation_slot_type type;
+
+ static type get(const T& t, const S& = S()) BOOST_ASIO_NOEXCEPT
+ {
+ return t.get_cancellation_slot();
+ }
+};
+
+template
+struct associated_cancellation_slot_impl::value
+ >::type,
+ typename void_type<
+ typename associator::type
+ >::type> : associator
+{
+};
+
+} // namespace detail
+
+/// Traits type used to obtain the cancellation_slot associated with an object.
+/**
+ * A program may specialise this traits type if the @c T template parameter in
+ * the specialisation is a user-defined type. The template parameter @c
+ * CancellationSlot shall be a type meeting the CancellationSlot requirements.
+ *
+ * Specialisations shall meet the following requirements, where @c t is a const
+ * reference to an object of type @c T, and @c s is an object of type @c
+ * CancellationSlot.
+ *
+ * @li Provide a nested typedef @c type that identifies a type meeting the
+ * CancellationSlot requirements.
+ *
+ * @li Provide a noexcept static member function named @c get, callable as @c
+ * get(t) and with return type @c type.
+ *
+ * @li Provide a noexcept static member function named @c get, callable as @c
+ * get(t,s) and with return type @c type.
+ */
+template
+struct associated_cancellation_slot
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_cancellation_slot_impl
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+#if defined(GENERATING_DOCUMENTATION)
+ /// If @c T has a nested type @c cancellation_slot_type,
+ /// T::cancellation_slot_type. Otherwise
+ /// @c CancellationSlot.
+ typedef see_below type;
+
+ /// If @c T has a nested type @c cancellation_slot_type, returns
+ /// t.get_cancellation_slot(). Otherwise returns @c s.
+ static type get(const T& t,
+ const CancellationSlot& s = CancellationSlot()) BOOST_ASIO_NOEXCEPT;
+#endif // defined(GENERATING_DOCUMENTATION)
+};
+
+/// Helper function to obtain an object's associated cancellation_slot.
+/**
+ * @returns associated_cancellation_slot::get(t)
+ */
+template
+BOOST_ASIO_NODISCARD inline typename associated_cancellation_slot::type
+get_associated_cancellation_slot(const T& t) BOOST_ASIO_NOEXCEPT
+{
+ return associated_cancellation_slot::get(t);
+}
+
+/// Helper function to obtain an object's associated cancellation_slot.
+/**
+ * @returns associated_cancellation_slot::get(t, st)
+ */
+template
+BOOST_ASIO_NODISCARD inline
+typename associated_cancellation_slot::type
+get_associated_cancellation_slot(const T& t,
+ const CancellationSlot& st) BOOST_ASIO_NOEXCEPT
+{
+ return associated_cancellation_slot::get(t, st);
+}
+
+#if defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
+
+template
+using associated_cancellation_slot_t =
+ typename associated_cancellation_slot::type;
+
+#endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
+
+namespace detail {
+
+template
+struct associated_cancellation_slot_forwarding_base
+{
+};
+
+template
+struct associated_cancellation_slot_forwarding_base::asio_associated_cancellation_slot_is_unspecialised,
+ void
+ >::value
+ >::type>
+{
+ typedef void asio_associated_cancellation_slot_is_unspecialised;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include
+
+#endif // BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP
diff --git a/boost/asio/associated_executor.hpp b/boost/asio/associated_executor.hpp
index 6d4ac65f3b0070d41213b7a5118c73de7870c09f..02738aac820d6270bedb0abc8424b585e1795d3d 100644
--- a/boost/asio/associated_executor.hpp
+++ b/boost/asio/associated_executor.hpp
@@ -2,7 +2,7 @@
// associated_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
@@ -16,6 +16,8 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include
+#include
+#include
#include
#include
#include
@@ -25,9 +27,25 @@
namespace boost {
namespace asio {
+
+template
+struct associated_executor;
+
namespace detail {
-template
+template
+struct has_executor_type : false_type
+{
+};
+
+template
+struct has_executor_type::type>
+ : true_type
+{
+};
+
+template
struct associated_executor_impl
{
typedef void asio_associated_executor_is_unspecialised;
@@ -52,6 +70,17 @@ struct associated_executor_impl
+struct associated_executor_impl::value
+ >::type,
+ typename void_type<
+ typename associator::type
+ >::type> : associator
+{
+};
+
} // namespace detail
/// Traits type used to obtain the executor associated with an object.
@@ -96,7 +125,7 @@ struct associated_executor
* @returns associated_executor::get(t)
*/
template
-inline typename associated_executor::type
+BOOST_ASIO_NODISCARD inline typename associated_executor::type
get_associated_executor(const T& t) BOOST_ASIO_NOEXCEPT
{
return associated_executor::get(t);
@@ -107,7 +136,7 @@ get_associated_executor(const T& t) BOOST_ASIO_NOEXCEPT
* @returns associated_executor::get(t, ex)
*/
template
-inline typename associated_executor::type
+BOOST_ASIO_NODISCARD inline typename associated_executor::type
get_associated_executor(const T& t, const Executor& ex,
typename constraint<
is_executor::value || execution::is_executor::value
@@ -122,7 +151,7 @@ get_associated_executor(const T& t, const Executor& ex,
* ExecutionContext::executor_type>::get(t, ctx.get_executor())
*/
template
-inline typename associated_executor::type
get_associated_executor(const T& t, ExecutionContext& ctx,
typename constraint
+struct associated_executor, Executor>
+#if !defined(GENERATING_DOCUMENTATION)
+ : detail::associated_executor_forwarding_base
+#endif // !defined(GENERATING_DOCUMENTATION)
+{
+ /// Forwards @c type to the associator specialisation for the unwrapped type
+ /// @c T.
+ typedef typename associated_executor::type type;
+
+ /// Forwards the request to get the executor to the associator specialisation
+ /// for the unwrapped type @c T.
+ static type get(reference_wrapper t,
+ const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT
+ {
+ return associated_executor::get(t.get(), ex);
+ }
+};
+
+#endif // defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER)
+ // || defined(GENERATING_DOCUMENTATION)
+
} // namespace asio
} // namespace boost
diff --git a/boost/asio/associator.hpp b/boost/asio/associator.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bc775b01078db98875652940b6188d7be2c0b9e5
--- /dev/null
+++ b/boost/asio/associator.hpp
@@ -0,0 +1,37 @@
+//
+// associator.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2022 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)
+//
+
+#ifndef BOOST_ASIO_ASSOCIATOR_HPP
+#define BOOST_ASIO_ASSOCIATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include
+
+#include
+
+namespace boost {
+namespace asio {
+
+/// Used to generically specialise associators for a type.
+template class Associator,
+ typename T, typename DefaultCandidate>
+struct associator
+{
+};
+
+} // namespace asio
+} // namespace boost
+
+#include
+
+#endif // BOOST_ASIO_ASSOCIATOR_HPP
diff --git a/boost/asio/async_result.hpp b/boost/asio/async_result.hpp
index 3bcf424619660e21eb1f4a5de7a652d6e890991c..1e735cbee23dac61042ab2565371e353a051ca93 100644
--- a/boost/asio/async_result.hpp
+++ b/boost/asio/async_result.hpp
@@ -2,7 +2,7 @@
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 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)
@@ -40,13 +40,64 @@ struct is_completion_signature : true_type
{
};
+#if defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
+
+template
+struct is_completion_signature : true_type
+{
+};
+
+template
+struct is_completion_signature : true_type
+{
+};
+
+# if defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+
+template
+struct is_completion_signature : true_type
+{
+};
+
+template
+struct is_completion_signature : true_type
+{
+};
+
+template
+struct is_completion_signature : true_type
+{
+};
+
+# endif // defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+#endif // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
+
+template
+struct are_completion_signatures : false_type
+{
+};
+
+template
+struct are_completion_signatures
+ : is_completion_signature
+{
+};
+
+template
+struct are_completion_signatures
+ : integral_constant::value
+ && are_completion_signatures::value)>
+{
+};
+
template
-BOOST_ASIO_CONCEPT callable_with = requires(T t, Args&&... args)
+BOOST_ASIO_CONCEPT callable_with = requires(T&& t, Args&&... args)
{
- t(static_cast(args)...);
+ static_cast(t)(static_cast(args)...);
};
-template
+template
struct is_completion_handler_for : false_type
{
};
@@ -57,6 +108,51 @@ struct is_completion_handler_for
{
};
+#if defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
+
+template
+struct is_completion_handler_for
+ : integral_constant)>
+{
+};
+
+template
+struct is_completion_handler_for
+ : integral_constant)>
+{
+};
+
+# if defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+
+template
+struct is_completion_handler_for
+ : integral_constant)>
+{
+};
+
+template
+struct is_completion_handler_for
+ : integral_constant)>
+{
+};
+
+template
+struct is_completion_handler_for
+ : integral_constant)>
+{
+};
+
+# endif // defined(BOOST_ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)
+#endif // defined(BOOST_ASIO_HAS_REF_QUALIFIED_FUNCTIONS)
+
+template
+struct is_completion_handler_for
+ : integral_constant::value
+ && is_completion_handler_for::value)>
+{
+};
+
} // namespace detail
template
@@ -66,83 +162,317 @@ BOOST_ASIO_CONCEPT completion_signature =
#define BOOST_ASIO_COMPLETION_SIGNATURE \
::boost::asio::completion_signature
-template
+template
BOOST_ASIO_CONCEPT completion_handler_for =
- detail::is_completion_signature::value
- && detail::is_completion_handler_for::value;
+ detail::are_completion_signatures::value
+ && detail::is_completion_handler_for::value;
-#define BOOST_ASIO_COMPLETION_HANDLER_FOR(s) \
- ::boost::asio::completion_handler_for
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR(sig) \
+ ::boost::asio::completion_handler_for
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR2(sig0, sig1) \
+ ::boost::asio::completion_handler_for
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR3(sig0, sig1, sig2) \
+ ::boost::asio::completion_handler_for
#else // defined(BOOST_ASIO_HAS_CONCEPTS)
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
// && defined(BOOST_ASIO_HAS_DECLTYPE)
#define BOOST_ASIO_COMPLETION_SIGNATURE typename
-#define BOOST_ASIO_COMPLETION_HANDLER_FOR(s) typename
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR(sig) typename
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR2(sig0, sig1) typename
+#define BOOST_ASIO_COMPLETION_HANDLER_FOR3(sig0, sig1, sig2) typename
#endif // defined(BOOST_ASIO_HAS_CONCEPTS)
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
// && defined(BOOST_ASIO_HAS_DECLTYPE)
-/// An interface for customising the behaviour of an initiating function.
-/**
- * The async_result traits class is used for determining:
- *
- * @li the concrete completion handler type to be called at the end of the
- * asynchronous operation;
- *
- * @li the initiating function return type; and
- *
- * @li how the return value of the initiating function is obtained.
- *
- * The trait allows the handler and return types to be determined at the point
- * where the specific completion handler signature is known.
- *
- * This template may be specialised for user-defined completion token types.
- * The primary template assumes that the CompletionToken is the completion
- * handler.
- */
-template
-class async_result
+namespace detail {
+
+template
+struct is_simple_completion_signature : false_type
+{
+};
+
+template
+struct simple_completion_signature;
+
+#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
+
+template
+struct is_simple_completion_signature : true_type
+{
+};
+
+template
+struct are_simple_completion_signatures : false_type
+{
+};
+
+template
+struct are_simple_completion_signatures
+ : is_simple_completion_signature