mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
bind_handler works with boost placeholders
This commit is contained in:
@@ -2,6 +2,7 @@ Version 154:
|
|||||||
|
|
||||||
* Type check completion handlers
|
* Type check completion handlers
|
||||||
* bind_handler doc update
|
* bind_handler doc update
|
||||||
|
* bind_handler works with boost placeholders
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <boost/asio/associated_executor.hpp>
|
#include <boost/asio/associated_executor.hpp>
|
||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/core/ignore_unused.hpp>
|
#include <boost/core/ignore_unused.hpp>
|
||||||
|
#include <boost/is_placeholder.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@@ -45,8 +46,10 @@ class bound_handler
|
|||||||
static
|
static
|
||||||
typename std::enable_if<
|
typename std::enable_if<
|
||||||
std::is_placeholder<typename
|
std::is_placeholder<typename
|
||||||
|
std::decay<Arg>::type>::value == 0 &&
|
||||||
|
boost::is_placeholder<typename
|
||||||
std::decay<Arg>::type>::value == 0,
|
std::decay<Arg>::type>::value == 0,
|
||||||
Arg&&>::type
|
Arg&&>::type
|
||||||
extract(Arg&& arg, Vals& vals)
|
extract(Arg&& arg, Vals& vals)
|
||||||
{
|
{
|
||||||
boost::ignore_unused(vals);
|
boost::ignore_unused(vals);
|
||||||
@@ -58,10 +61,10 @@ class bound_handler
|
|||||||
typename std::enable_if<
|
typename std::enable_if<
|
||||||
std::is_placeholder<typename
|
std::is_placeholder<typename
|
||||||
std::decay<Arg>::type>::value != 0,
|
std::decay<Arg>::type>::value != 0,
|
||||||
typename std::tuple_element<
|
typename std::tuple_element<
|
||||||
std::is_placeholder<
|
std::is_placeholder<
|
||||||
typename std::decay<Arg>::type>::value - 1,
|
typename std::decay<Arg>::type>::value - 1,
|
||||||
Vals>::type&&>::type
|
Vals>>::type::type&&
|
||||||
extract(Arg&&, Vals&& vals)
|
extract(Arg&&, Vals&& vals)
|
||||||
{
|
{
|
||||||
return std::get<std::is_placeholder<
|
return std::get<std::is_placeholder<
|
||||||
@@ -69,6 +72,22 @@ class bound_handler
|
|||||||
std::forward<Vals>(vals));
|
std::forward<Vals>(vals));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Arg, class Vals>
|
||||||
|
static
|
||||||
|
typename std::enable_if<
|
||||||
|
boost::is_placeholder<typename
|
||||||
|
std::decay<Arg>::type>::value != 0,
|
||||||
|
typename std::tuple_element<
|
||||||
|
boost::is_placeholder<
|
||||||
|
typename std::decay<Arg>::type>::value - 1,
|
||||||
|
Vals>>::type::type&&
|
||||||
|
extract(Arg&&, Vals&& vals)
|
||||||
|
{
|
||||||
|
return std::get<boost::is_placeholder<
|
||||||
|
typename std::decay<Arg>::type>::value - 1>(
|
||||||
|
std::forward<Vals>(vals));
|
||||||
|
}
|
||||||
|
|
||||||
template<
|
template<
|
||||||
class ArgsTuple,
|
class ArgsTuple,
|
||||||
std::size_t... S>
|
std::size_t... S>
|
||||||
|
Reference in New Issue
Block a user