mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 05:17:26 +02:00
bind_front_handler works with member functions
This commit is contained in:
@ -2,6 +2,7 @@ Version 215:
|
|||||||
|
|
||||||
* basic_stream uses boost::shared_ptr
|
* basic_stream uses boost::shared_ptr
|
||||||
* Remove bind_back_handler
|
* Remove bind_back_handler
|
||||||
|
* bind_front_handler works with member functions
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -217,6 +217,7 @@ class bind_front_wrapper
|
|||||||
template<std::size_t... I, class... Ts>
|
template<std::size_t... I, class... Ts>
|
||||||
void
|
void
|
||||||
invoke(
|
invoke(
|
||||||
|
std::false_type,
|
||||||
mp11::index_sequence<I...>,
|
mp11::index_sequence<I...>,
|
||||||
Ts&&... ts)
|
Ts&&... ts)
|
||||||
{
|
{
|
||||||
@ -224,6 +225,18 @@ class bind_front_wrapper
|
|||||||
std::forward<Ts>(ts)...);
|
std::forward<Ts>(ts)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<std::size_t... I, class... Ts>
|
||||||
|
void
|
||||||
|
invoke(
|
||||||
|
std::true_type,
|
||||||
|
mp11::index_sequence<I...>,
|
||||||
|
Ts&&... ts)
|
||||||
|
{
|
||||||
|
std::mem_fn(h_)(
|
||||||
|
detail::get<I>(std::move(args_))...,
|
||||||
|
std::forward<Ts>(ts)...);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using result_type = void; // asio needs this
|
using result_type = void; // asio needs this
|
||||||
|
|
||||||
@ -243,6 +256,7 @@ public:
|
|||||||
void operator()(Ts&&... ts)
|
void operator()(Ts&&... ts)
|
||||||
{
|
{
|
||||||
invoke(
|
invoke(
|
||||||
|
std::is_member_function_pointer<Handler>{},
|
||||||
mp11::index_sequence_for<Args...>{},
|
mp11::index_sequence_for<Args...>{},
|
||||||
std::forward<Ts>(ts)...);
|
std::forward<Ts>(ts)...);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user