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 
67 } // MSGPACK_API_VERSION_NAMESPACE(v1)
69 
70 } // namespace msgpack
71 
72 
73 #else // MSGPACK_USE_CPP03
74 
75 #include <memory>
76 #include <tuple>
77 
78 namespace msgpack {
82 
83  // unique_ptr
84  using std::unique_ptr;
85  // using std::make_unique; // since C++14
86  using std::hash;
87 
88  // utility
89  using std::move;
90  using std::swap;
91  using std::enable_if;
92  using std::is_same;
93  using std::underlying_type;
94 
96 } // MSGPACK_API_VERSION_NAMESPACE(v1)
98 } // namespace msgpack
99 
100 
101 #endif // MSGPACK_USE_CPP03
102 
103 #endif // MSGPACK_V1_CPP_CONFIG_DECL_HPP
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
T const & move(T const &t)
Definition: cpp_config_decl.hpp:43
Definition: cpp_config_decl.hpp:55
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
T & move(T &t)