container_fwd.hpp 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // Copyright 2005-2011 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. // Note: if you change this include guard, you also need to change
  5. // container_fwd_compile_fail.cpp
  6. #if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP)
  7. #define BOOST_DETAIL_CONTAINER_FWD_HPP
  8. #if defined(_MSC_VER) && \
  9. !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
  10. # pragma once
  11. #endif
  12. #include <boost/config.hpp>
  13. #include <boost/detail/workaround.hpp>
  14. ////////////////////////////////////////////////////////////////////////////////
  15. // //
  16. // Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
  17. // forward declare standard containers. //
  18. // //
  19. // BOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
  20. // normally doesn't. //
  21. // //
  22. // BOOST_DETAIL_NO_CONTAINER_FWD overrides BOOST_DETAIL_CONTAINER_FWD. //
  23. // //
  24. ////////////////////////////////////////////////////////////////////////////////
  25. #if !defined(BOOST_DETAIL_NO_CONTAINER_FWD)
  26. # if defined(BOOST_DETAIL_CONTAINER_FWD)
  27. // Force forward declarations.
  28. # elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
  29. // STLport
  30. # define BOOST_DETAIL_NO_CONTAINER_FWD
  31. # elif defined(__LIBCOMO__)
  32. // Comeau STL:
  33. # define BOOST_DETAIL_NO_CONTAINER_FWD
  34. # elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
  35. // Rogue Wave library:
  36. # define BOOST_DETAIL_NO_CONTAINER_FWD
  37. # elif defined(_LIBCPP_VERSION)
  38. // libc++
  39. # define BOOST_DETAIL_NO_CONTAINER_FWD
  40. # elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
  41. // GNU libstdc++ 3
  42. //
  43. // Disable forwarding for all recent versions, as the library has a
  44. // versioned namespace mode, and I don't know how to detect it.
  45. # if __GLIBCXX__ >= 20070513 \
  46. || defined(_GLIBCXX_DEBUG) \
  47. || defined(_GLIBCXX_PARALLEL) \
  48. || defined(_GLIBCXX_PROFILE)
  49. # define BOOST_DETAIL_NO_CONTAINER_FWD
  50. # else
  51. # if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
  52. # define BOOST_CONTAINER_FWD_COMPLEX_STRUCT
  53. # endif
  54. # endif
  55. # elif defined(__STL_CONFIG_H)
  56. // generic SGI STL
  57. //
  58. // Forward declaration seems to be okay, but it has a couple of odd
  59. // implementations.
  60. # define BOOST_CONTAINER_FWD_BAD_BITSET
  61. # if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
  62. # define BOOST_CONTAINER_FWD_BAD_DEQUE
  63. # endif
  64. # elif defined(__MSL_CPP__)
  65. // MSL standard lib:
  66. # define BOOST_DETAIL_NO_CONTAINER_FWD
  67. # elif defined(__IBMCPP__)
  68. // The default VACPP std lib, forward declaration seems to be fine.
  69. # elif defined(MSIPL_COMPILE_H)
  70. // Modena C++ standard library
  71. # define BOOST_DETAIL_NO_CONTAINER_FWD
  72. # elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
  73. // Dinkumware Library (this has to appear after any possible replacement
  74. // libraries)
  75. # else
  76. # define BOOST_DETAIL_NO_CONTAINER_FWD
  77. # endif
  78. #endif
  79. #if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY)
  80. #if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
  81. !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
  82. #include <deque>
  83. #include <list>
  84. #include <vector>
  85. #include <map>
  86. #include <set>
  87. #include <bitset>
  88. #include <string>
  89. #include <complex>
  90. #else
  91. #include <cstddef>
  92. #if defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
  93. #include <deque>
  94. #endif
  95. #if defined(BOOST_CONTAINER_FWD_BAD_BITSET)
  96. #include <bitset>
  97. #endif
  98. #if defined(BOOST_MSVC)
  99. #pragma warning(push)
  100. #pragma warning(disable:4099) // struct/class mismatch in fwd declarations
  101. #endif
  102. namespace std
  103. {
  104. template <class T> class allocator;
  105. template <class charT, class traits, class Allocator> class basic_string;
  106. template <class charT> struct char_traits;
  107. #if defined(BOOST_CONTAINER_FWD_COMPLEX_STRUCT)
  108. template <class T> struct complex;
  109. #else
  110. template <class T> class complex;
  111. #endif
  112. #if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE)
  113. template <class T, class Allocator> class deque;
  114. #endif
  115. template <class T, class Allocator> class list;
  116. template <class T, class Allocator> class vector;
  117. template <class Key, class T, class Compare, class Allocator> class map;
  118. template <class Key, class T, class Compare, class Allocator>
  119. class multimap;
  120. template <class Key, class Compare, class Allocator> class set;
  121. template <class Key, class Compare, class Allocator> class multiset;
  122. #if !defined(BOOST_CONTAINER_FWD_BAD_BITSET)
  123. template <size_t N> class bitset;
  124. #endif
  125. template <class T1, class T2> struct pair;
  126. }
  127. #if defined(BOOST_MSVC)
  128. #pragma warning(pop)
  129. #endif
  130. #endif // BOOST_DETAIL_NO_CONTAINER_FWD &&
  131. // !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
  132. #endif // BOOST_DETAIL_TEST_CONFIG_ONLY
  133. #endif