mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +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
|
||||
* 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>
|
||||
void
|
||||
invoke(
|
||||
std::false_type,
|
||||
mp11::index_sequence<I...>,
|
||||
Ts&&... ts)
|
||||
{
|
||||
@ -224,6 +225,18 @@ class bind_front_wrapper
|
||||
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:
|
||||
using result_type = void; // asio needs this
|
||||
|
||||
@ -243,6 +256,7 @@ public:
|
||||
void operator()(Ts&&... ts)
|
||||
{
|
||||
invoke(
|
||||
std::is_member_function_pointer<Handler>{},
|
||||
mp11::index_sequence_for<Args...>{},
|
||||
std::forward<Ts>(ts)...);
|
||||
}
|
||||
|
Reference in New Issue
Block a user