ゴミ箱
bind_handler.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/beast
8 //
9 
10 #ifndef BOOST_BEAST_BIND_HANDLER_HPP
11 #define BOOST_BEAST_BIND_HANDLER_HPP
12 
13 #include <boost/beast/config.hpp>
16 #include <type_traits>
17 #include <utility>
18 
19 namespace boost {
20 namespace beast {
21 
57 template<class Handler, class... Args>
58 #if BOOST_BEAST_DOXYGEN
59 implementation_defined
60 #else
61 detail::bound_handler<
62  typename std::decay<Handler>::type, Args...>
63 #endif
64 bind_handler(Handler&& handler, Args&&... args)
65 {
66 #if 0
67  static_assert(is_completion_handler<
68  Handler, void(Args...)>::value,
69  "Handler requirements not met");
70 #endif
71  return detail::bound_handler<typename std::decay<
72  Handler>::type, Args...>(std::forward<
73  Handler>(handler), std::forward<Args>(args)...);
74 }
75 
76 } // beast
77 } // boost
78 
79 #endif
Definition: async_result.hpp:20
std::integral_constant< bool, std::is_copy_constructible< typename std::decay< T >::type >::value &&detail::is_invocable< T, Signature >::value > is_completion_handler
Definition: type_traits.hpp:203
detail::bound_handler< typename std::decay< Handler >::type, Args... > bind_handler(Handler &&handler, Args &&...args)
Definition: bind_handler.hpp:64
Definition: bind_handler.hpp:31