cpp_config_decl.hpp 2.5 KB

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