1 | // |
2 | // detail/type_traits.hpp |
3 | // ~~~~~~~~~~~~~~~~~~~~~~ |
4 | // |
5 | // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) |
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> |
24 | # include <boost/type_traits/is_const.hpp> |
25 | # include <boost/type_traits/is_convertible.hpp> |
26 | # include <boost/type_traits/is_function.hpp> |
27 | # include <boost/type_traits/is_same.hpp> |
28 | # include <boost/type_traits/remove_pointer.hpp> |
29 | # include <boost/type_traits/remove_reference.hpp> |
30 | # include <boost/utility/enable_if.hpp> |
31 | #endif // defined(BOOST_ASIO_HAS_TYPE_TRAITS) |
32 | |
33 | namespace boost { |
34 | namespace asio { |
35 | |
36 | #if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) |
37 | using std::add_const; |
38 | using std::enable_if; |
39 | using std::is_const; |
40 | using std::is_convertible; |
41 | using std::is_function; |
42 | using std::is_same; |
43 | using std::remove_pointer; |
44 | using std::remove_reference; |
45 | #else // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) |
46 | using boost::add_const; |
47 | template <bool Condition, typename Type = void> |
48 | struct enable_if : boost::enable_if_c<Condition, Type> {}; |
49 | using boost::is_const; |
50 | using boost::is_convertible; |
51 | using boost::is_function; |
52 | using boost::is_same; |
53 | using boost::remove_pointer; |
54 | using boost::remove_reference; |
55 | #endif // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS) |
56 | |
57 | } // namespace asio |
58 | } // namespace boost |
59 | |
60 | #endif // BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP |
61 | |