fwd.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (C) 2008-2016 Daniel James.
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_UNORDERED_FWD_HPP_INCLUDED
  5. #define BOOST_UNORDERED_FWD_HPP_INCLUDED
  6. #include <boost/config.hpp>
  7. #if defined(BOOST_HAS_PRAGMA_ONCE)
  8. #pragma once
  9. #endif
  10. #include <boost/predef.h>
  11. #if defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
  12. // Already defined.
  13. #elif defined(BOOST_LIBSTDCXX11)
  14. // https://github.com/gcc-mirror/gcc/blob/gcc-4_6-branch/libstdc++-v3/include/bits/stl_pair.h#L70
  15. #if BOOST_LIBSTDCXX_VERSION > 40600
  16. #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
  17. #endif
  18. #elif BOOST_LIB_STD_CXX
  19. // https://github.com/llvm-mirror/libcxx/blob/release_30/include/utility#L206
  20. #if BOOST_LIB_STD_CXX >= BOOST_VERSION_NUMBER(3, 0, 0)
  21. #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
  22. #endif
  23. #elif defined(BOOST_LIB_STD_DINKUMWARE)
  24. // Apparently C++11 standard supported in Visual Studio 2012
  25. // https://msdn.microsoft.com/en-us/library/hh567368.aspx#stl
  26. // 2012 = VC+11 = BOOST_MSVC 1700 Hopefully!
  27. // I have no idea when Dinkumware added it, probably a lot
  28. // earlier than this check.
  29. #if BOOST_LIB_STD_DINKUMWARE >= BOOST_VERSION_NUMBER(6, 50, 0) || \
  30. BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(17, 0, 0)
  31. #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
  32. #endif
  33. #endif
  34. // Assume that an unknown library does not support piecewise construction.
  35. #if !defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
  36. #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 0
  37. #endif
  38. #if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
  39. #include <utility>
  40. #endif
  41. namespace boost {
  42. namespace unordered {
  43. #if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
  44. using std::piecewise_construct_t;
  45. using std::piecewise_construct;
  46. #else
  47. struct piecewise_construct_t
  48. {
  49. };
  50. const piecewise_construct_t piecewise_construct = piecewise_construct_t();
  51. #endif
  52. }
  53. }
  54. #endif