From c9bbf7bdbc54f4f43a9024881acc9416303c31de Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 26 Jan 2018 10:12:40 -0800 Subject: [PATCH] bind_handler works with boost placeholders --- CHANGELOG.md | 1 + .../boost/beast/core/detail/bind_handler.hpp | 29 +++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c72ea491..3cbc49df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 154: * Type check completion handlers * bind_handler doc update +* bind_handler works with boost placeholders -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/detail/bind_handler.hpp b/include/boost/beast/core/detail/bind_handler.hpp index 5f5c612b..c103de92 100644 --- a/include/boost/beast/core/detail/bind_handler.hpp +++ b/include/boost/beast/core/detail/bind_handler.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -45,8 +46,10 @@ class bound_handler static typename std::enable_if< std::is_placeholder::type>::value == 0 && + boost::is_placeholder::type>::value == 0, - Arg&&>::type + Arg&&>::type extract(Arg&& arg, Vals& vals) { boost::ignore_unused(vals); @@ -58,10 +61,10 @@ class bound_handler typename std::enable_if< std::is_placeholder::type>::value != 0, - typename std::tuple_element< - std::is_placeholder< - typename std::decay::type>::value - 1, - Vals>::type&&>::type + typename std::tuple_element< + std::is_placeholder< + typename std::decay::type>::value - 1, + Vals>>::type::type&& extract(Arg&&, Vals&& vals) { return std::get(vals)); } + template + static + typename std::enable_if< + boost::is_placeholder::type>::value != 0, + typename std::tuple_element< + boost::is_placeholder< + typename std::decay::type>::value - 1, + Vals>>::type::type&& + extract(Arg&&, Vals&& vals) + { + return std::get::type>::value - 1>( + std::forward(vals)); + } + template< class ArgsTuple, std::size_t... S>