MessagePack for C++
cpp_config_decl.hpp
Go to the documentation of this file.
1 //
2 // MessagePack for C++ C++03/C++11 Adaptation
3 //
4 // Copyright (C) 2016 KONDO Takatoshi
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 //
10 #ifndef MSGPACK_V1_CPP_CONFIG_DECL_HPP
11 #define MSGPACK_V1_CPP_CONFIG_DECL_HPP
12 
13 #include "msgpack/versioning.hpp"
14 
15 #if !defined(MSGPACK_USE_CPP03)
16 # if defined(_MSC_VER)
17 # if _MSC_VER < 1900
18 # define MSGPACK_USE_CPP03
19 # endif
20 # elif (__cplusplus < 201103L)
21 # define MSGPACK_USE_CPP03
22 # endif
23 #endif // MSGPACK_USE_CPP03
24 
25 
26 #if defined(MSGPACK_USE_CPP03)
27 
28 #if !defined(nullptr)
29 # if _MSC_VER < 1600
30 # define nullptr (0)
31 # endif
32 #endif
33 
34 #include <memory>
35 
36 namespace msgpack {
37 
41 
42 template <typename T>
43 struct unique_ptr;
44 
45 template <typename T>
46 T& move(T& t);
47 
48 template <typename T>
49 T const& move(T const& t);
50 
51 template <bool P, typename T = void>
52 struct enable_if;
53 
54 template<typename T, T val>
56 
59 
60 template<class T, class U>
61 struct is_same;
62 
63 template<typename T>
65 
66 template<class T>
67 struct is_array;
68 
69 template<class T>
70 struct remove_const;
71 template<class T>
73 template<class T>
74 struct remove_cv;
75 
76 template<class T>
77 struct is_pointer;
78 
80 } // MSGPACK_API_VERSION_NAMESPACE(v1)
82 
83 } // namespace msgpack
84 
85 
86 #else // MSGPACK_USE_CPP03
87 
88 #include <memory>
89 #include <tuple>
90 
91 namespace msgpack {
95 
96  // unique_ptr
97  using std::unique_ptr;
98  // using std::make_unique; // since C++14
99  using std::hash;
100 
101  // utility
102  using std::move;
103  using std::swap;
104  using std::enable_if;
105  using std::is_same;
106  using std::underlying_type;
107  using std::is_array;
108  using std::remove_const;
109  using std::remove_volatile;
110  using std::remove_cv;
111  using std::is_pointer;
112 
114 } // MSGPACK_API_VERSION_NAMESPACE(v1)
116 } // namespace msgpack
117 
118 
119 #endif // MSGPACK_USE_CPP03
120 
121 #endif // MSGPACK_V1_CPP_CONFIG_DECL_HPP
Definition: cpp_config_decl.hpp:67
Definition: cpp_config_decl.hpp:70
Definition: cpp_config_decl.hpp:64
integral_constant< bool, true > true_type
Definition: cpp_config_decl.hpp:55
Definition: cpp_config_decl.hpp:61
Definition: adaptor_base.hpp:15
Definition: cpp_config_decl.hpp:74
T const & move(T const &t)
Definition: cpp_config_decl.hpp:43
Definition: cpp_config_decl.hpp:55
Definition: cpp_config_decl.hpp:77
Definition: cpp_config_decl.hpp:52
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
integral_constant< bool, false > false_type
Definition: cpp_config_decl.hpp:58
Definition: cpp_config_decl.hpp:72
T & move(T &t)