MessagePack for C++
cpp_config.hpp
Go to the documentation of this file.
1 //
2 // MessagePack for C++ C++03/C++11 Adaptation
3 //
4 // Copyright (C) 2013-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_HPP
11 #define MSGPACK_V1_CPP_CONFIG_HPP
12 
14 
15 #if defined(MSGPACK_USE_CPP03)
16 
17 namespace msgpack {
18 
22 
23 template <typename T>
24 struct unique_ptr : std::auto_ptr<T> {
25  explicit unique_ptr(T* p = 0) throw() : std::auto_ptr<T>(p) {}
26  unique_ptr(unique_ptr& a) throw() : std::auto_ptr<T>(a) {}
27  template<class Y>
28  unique_ptr (unique_ptr<Y>& a) throw() : std::auto_ptr<T>(a) {}
29 };
30 
31 template <typename T>
32 T& move(T& t)
33 {
34  return t;
35 }
36 
37 template <typename T>
38 T const& move(T const& t)
39 {
40  return t;
41 }
42 
43 template <bool P, typename T>
44 struct enable_if {
45  typedef T type;
46 };
47 
48 template <typename T>
49 struct enable_if<false, T> {
50 };
51 
52 template<typename T, T val>
53 struct integral_constant {
54  static T const value = val;
55  typedef T value_type;
56  typedef integral_constant<T, val> type;
57 };
58 
59 typedef integral_constant<bool, true> true_type;
60 typedef integral_constant<bool, false> false_type;
61 
62 template<class T, class U>
63 struct is_same : false_type {};
64 
65 template<class T>
66 struct is_same<T, T> : true_type {};
67 
68 template<typename T>
69 struct underlying_type {
70  typedef int type;
71 };
72 
74 } // MSGPACK_API_VERSION_NAMESPACE(v1)
76 
77 } // namespace msgpack
78 
79 #endif // MSGPACK_USE_CPP03
80 
81 #endif // MSGPACK_V1_CPP_CONFIG_HPP
integral_constant< bool, true > true_type
Definition: cpp_config_decl.hpp:55
Definition: adaptor_base.hpp:15
#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)