]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // detail/type_traits.hpp | |
3 | // ~~~~~~~~~~~~~~~~~~~~~~ | |
4 | // | |
92f5a8d4 | 5 | // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) |
7c673cae FG |
6 | // |
7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
9 | // | |
10 | ||
11 | #ifndef BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP | |
12 | #define BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP | |
13 | ||
14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) | |
15 | # pragma once | |
16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | |
17 | ||
18 | #include <boost/asio/detail/config.hpp> | |
19 | ||
20 | #if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) | |
21 | # include <type_traits> | |
22 | #else // defined(BOOST_ASIO_HAS_TYPE_TRAITS) | |
23 | # include <boost/type_traits/add_const.hpp> | |
b32b8144 FG |
24 | # include <boost/type_traits/conditional.hpp> |
25 | # include <boost/type_traits/decay.hpp> | |
26 | # include <boost/type_traits/integral_constant.hpp> | |
27 | # include <boost/type_traits/is_base_of.hpp> | |
28 | # include <boost/type_traits/is_class.hpp> | |
7c673cae FG |
29 | # include <boost/type_traits/is_const.hpp> |
30 | # include <boost/type_traits/is_convertible.hpp> | |
31 | # include <boost/type_traits/is_function.hpp> | |
32 | # include <boost/type_traits/is_same.hpp> | |
33 | # include <boost/type_traits/remove_pointer.hpp> | |
34 | # include <boost/type_traits/remove_reference.hpp> | |
92f5a8d4 | 35 | # include <boost/utility/declval.hpp> |
7c673cae | 36 | # include <boost/utility/enable_if.hpp> |
b32b8144 | 37 | # include <boost/utility/result_of.hpp> |
7c673cae FG |
38 | #endif // defined(BOOST_ASIO_HAS_TYPE_TRAITS) |
39 | ||
40 | namespace boost { | |
41 | namespace asio { | |
42 | ||
43 | #if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) | |
44 | using std::add_const; | |
b32b8144 FG |
45 | using std::conditional; |
46 | using std::decay; | |
92f5a8d4 | 47 | using std::declval; |
7c673cae | 48 | using std::enable_if; |
b32b8144 FG |
49 | using std::false_type; |
50 | using std::integral_constant; | |
51 | using std::is_base_of; | |
52 | using std::is_class; | |
7c673cae FG |
53 | using std::is_const; |
54 | using std::is_convertible; | |
55 | using std::is_function; | |
56 | using std::is_same; | |
57 | using std::remove_pointer; | |
58 | using std::remove_reference; | |
11fdf7f2 TL |
59 | #if defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT) |
60 | template <typename> struct result_of; | |
61 | template <typename F, typename... Args> | |
62 | struct result_of<F(Args...)> : std::invoke_result<F, Args...> {}; | |
63 | #else // defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT) | |
b32b8144 | 64 | using std::result_of; |
11fdf7f2 | 65 | #endif // defined(BOOST_ASIO_HAS_STD_INVOKE_RESULT) |
b32b8144 | 66 | using std::true_type; |
7c673cae FG |
67 | #else // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) |
68 | using boost::add_const; | |
69 | template <bool Condition, typename Type = void> | |
70 | struct enable_if : boost::enable_if_c<Condition, Type> {}; | |
b32b8144 FG |
71 | using boost::conditional; |
72 | using boost::decay; | |
92f5a8d4 | 73 | using boost::declval; |
b32b8144 FG |
74 | using boost::false_type; |
75 | using boost::integral_constant; | |
76 | using boost::is_base_of; | |
77 | using boost::is_class; | |
7c673cae FG |
78 | using boost::is_const; |
79 | using boost::is_convertible; | |
80 | using boost::is_function; | |
81 | using boost::is_same; | |
82 | using boost::remove_pointer; | |
83 | using boost::remove_reference; | |
b32b8144 FG |
84 | using boost::result_of; |
85 | using boost::true_type; | |
7c673cae FG |
86 | #endif // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) |
87 | ||
88 | } // namespace asio | |
89 | } // namespace boost | |
90 | ||
91 | #endif // BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP |