fwd.hpp 2.0 KB

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