]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/beast/core/type_traits.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / beast / core / type_traits.hpp
1 //
2 // Copyright (c) 2016-2019 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_TYPE_TRAITS_HPP
11 #define BOOST_BEAST_TYPE_TRAITS_HPP
12
13 #ifndef BOOST_BEAST_DOXYGEN
14
15 #include <boost/beast/core/detail/config.hpp>
16 #include <boost/beast/core/detail/is_invocable.hpp>
17 #include <boost/config/pragma_message.hpp>
18 #include <type_traits.hpp>
19
20 BOOST_PRAGMA_MESSAGE("<boost/beast/core/type_traits.hpp> is DEPRECATED and will be removed in a future release.")
21
22 namespace boost {
23 namespace beast {
24
25 /** Determine if `T` meets the requirements of <em>CompletionHandler</em>.
26
27 This trait checks whether a type meets the requirements for a completion
28 handler, and is also callable with the specified signature.
29 Metafunctions are used to perform compile time checking of template
30 types. This type will be `std::true_type` if `T` meets the requirements,
31 else the type will be `std::false_type`.
32
33 @par Example
34 Use with `static_assert`:
35 @code
36 struct handler
37 {
38 void operator()(error_code&);
39 };
40 static_assert(is_completion_handler<handler, void(error_code&)>::value,
41 "Not a completion handler");
42 @endcode
43 */
44 template<class T, class Signature>
45 #if BOOST_BEAST_DOXYGEN
46 using is_completion_handler = __see_below__
47 #else
48 using is_completion_handler = std::integral_constant<bool,
49 std::is_move_constructible<typename std::decay<T>::type>::value &&
50 detail::is_invocable<T, Signature>::value>;
51 #endif
52
53 } // beast
54 } // boost
55
56 #endif
57
58 #endif