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