cpp_config_decl.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. #include "msgpack/versioning.hpp"
  13. #if !defined(MSGPACK_USE_CPP03)
  14. # if defined(_MSC_VER)
  15. # if _MSC_VER < 1900
  16. # define MSGPACK_USE_CPP03
  17. # endif
  18. # elif (__cplusplus < 201103L)
  19. # define MSGPACK_USE_CPP03
  20. # endif
  21. #endif // MSGPACK_USE_CPP03
  22. #if defined(MSGPACK_USE_CPP03)
  23. #if defined(nullptr)
  24. # if defined (__cplusplus_cli)
  25. # define MSGPACK_NULLPTR __nullptr
  26. # else // defined (__cplusplus_cli)
  27. # define MSGPACK_NULLPTR nullptr
  28. # endif // defined (__cplusplus_cli)
  29. #else // defined(nullptr)
  30. # define MSGPACK_NULLPTR (0)
  31. #endif // defined(nullptr)
  32. #include <memory>
  33. namespace msgpack {
  34. /// @cond
  35. MSGPACK_API_VERSION_NAMESPACE(v1) {
  36. /// @endcond
  37. template <typename T>
  38. struct unique_ptr;
  39. template <typename T>
  40. T& move(T& t);
  41. template <typename T>
  42. T const& move(T const& t);
  43. template <bool P, typename T = void>
  44. struct enable_if;
  45. template<typename T, T val>
  46. struct integral_constant;
  47. typedef integral_constant<bool, true> true_type;
  48. typedef integral_constant<bool, false> false_type;
  49. template<class T, class U>
  50. struct is_same;
  51. template<typename T>
  52. struct underlying_type;
  53. template<class T>
  54. struct is_array;
  55. template<class T>
  56. struct remove_const;
  57. template<class T>
  58. struct remove_volatile;
  59. template<class T>
  60. struct remove_cv;
  61. template<class T>
  62. struct is_pointer;
  63. /// @cond
  64. } // MSGPACK_API_VERSION_NAMESPACE(v1)
  65. /// @endcond
  66. } // namespace msgpack
  67. #else // MSGPACK_USE_CPP03
  68. #if defined (__cplusplus_cli)
  69. # define MSGPACK_NULLPTR __nullptr
  70. #else // defined (__cplusplus_cli)
  71. # define MSGPACK_NULLPTR nullptr
  72. #endif // defined (__cplusplus_cli)
  73. #include <memory>
  74. #include <tuple>
  75. namespace msgpack {
  76. /// @cond
  77. MSGPACK_API_VERSION_NAMESPACE(v1) {
  78. /// @endcond
  79. // unique_ptr
  80. using std::unique_ptr;
  81. // using std::make_unique; // since C++14
  82. using std::hash;
  83. // utility
  84. using std::move;
  85. using std::swap;
  86. using std::enable_if;
  87. using std::is_same;
  88. using std::underlying_type;
  89. using std::is_array;
  90. using std::remove_const;
  91. using std::remove_volatile;
  92. using std::remove_cv;
  93. using std::is_pointer;
  94. /// @cond
  95. } // MSGPACK_API_VERSION_NAMESPACE(v1)
  96. /// @endcond
  97. } // namespace msgpack
  98. #endif // MSGPACK_USE_CPP03
  99. #if defined(__has_include)
  100. #define MSGPACK_HAS_INCLUDE __has_include
  101. #else // defined(__has_include)
  102. #define MSGPACK_HAS_INCLUDE(header) 0
  103. #endif // defined(__has_include)
  104. #endif // MSGPACK_V1_CPP_CONFIG_DECL_HPP