blob: 7081f071639e025eb9d57ed3708c4ce8bbf3acdc [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
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 Thompson3d613fd2013-10-15 15:39:04 -07008#if !defined(NDNBOOST_DETAIL_CONTAINER_FWD_HPP)
9#define NDNBOOST_DETAIL_CONTAINER_FWD_HPP
Jeff Thompsona28eed82013-08-22 16:21:10 -070010
11#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070012 !defined(NDNBOOST_DETAIL_TEST_CONFIG_ONLY)
Jeff Thompsona28eed82013-08-22 16:21:10 -070013# pragma once
14#endif
15
16#include <ndnboost/config.hpp>
17#include <ndnboost/detail/workaround.hpp>
18
19////////////////////////////////////////////////////////////////////////////////
20// //
Jeff Thompson3d613fd2013-10-15 15:39:04 -070021// Define NDNBOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to //
Jeff Thompsona28eed82013-08-22 16:21:10 -070022// forward declare standard containers. //
23// //
Jeff Thompson3d613fd2013-10-15 15:39:04 -070024// NDNBOOST_DETAIL_CONTAINER_FWD to make it foward declare containers even if it //
Jeff Thompsona28eed82013-08-22 16:21:10 -070025// normally doesn't. //
26// //
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027// NDNBOOST_DETAIL_NO_CONTAINER_FWD overrides NDNBOOST_DETAIL_CONTAINER_FWD. //
Jeff Thompsona28eed82013-08-22 16:21:10 -070028// //
29////////////////////////////////////////////////////////////////////////////////
30
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031#if !defined(NDNBOOST_DETAIL_NO_CONTAINER_FWD)
32# if defined(NDNBOOST_DETAIL_CONTAINER_FWD)
Jeff Thompsona28eed82013-08-22 16:21:10 -070033 // Force forward declarations.
34# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
35 // STLport
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070037# elif defined(__LIBCOMO__)
38 // Comeau STL:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070039# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070040# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
41 // Rogue Wave library:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070043# elif defined(_LIBCPP_VERSION)
44 // libc++
Jeff Thompson3d613fd2013-10-15 15:39:04 -070045# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070046# 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 Thompson3d613fd2013-10-15 15:39:04 -070055# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070056# else
57# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20040530
Jeff Thompson3d613fd2013-10-15 15:39:04 -070058# define NDNBOOST_CONTAINER_FWD_COMPLEX_STRUCT
Jeff Thompsona28eed82013-08-22 16:21:10 -070059# 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 Thompson3d613fd2013-10-15 15:39:04 -070066# define NDNBOOST_CONTAINER_FWD_BAD_BITSET
Jeff Thompsona28eed82013-08-22 16:21:10 -070067# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070068# define NDNBOOST_CONTAINER_FWD_BAD_DEQUE
Jeff Thompsona28eed82013-08-22 16:21:10 -070069# endif
70# elif defined(__MSL_CPP__)
71 // MSL standard lib:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070073# 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 Thompson3d613fd2013-10-15 15:39:04 -070077# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070078# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
79 // Dinkumware Library (this has to appear after any possible replacement
80 // libraries)
81# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070082# define NDNBOOST_DETAIL_NO_CONTAINER_FWD
Jeff Thompsona28eed82013-08-22 16:21:10 -070083# endif
84#endif
85
Jeff Thompson3d613fd2013-10-15 15:39:04 -070086#if !defined(NDNBOOST_DETAIL_TEST_CONFIG_ONLY)
Jeff Thompsona28eed82013-08-22 16:21:10 -070087
Jeff Thompson3d613fd2013-10-15 15:39:04 -070088#if defined(NDNBOOST_DETAIL_NO_CONTAINER_FWD) && \
89 !defined(NDNBOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
Jeff Thompsona28eed82013-08-22 16:21:10 -070090
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 Thompson3d613fd2013-10-15 15:39:04 -0700104#if defined(NDNBOOST_CONTAINER_FWD_BAD_DEQUE)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700105#include <deque>
106#endif
107
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700108#if defined(NDNBOOST_CONTAINER_FWD_BAD_BITSET)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700109#include <bitset>
110#endif
111
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700112#if defined(NDNBOOST_MSVC)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700113#pragma warning(push)
114#pragma warning(disable:4099) // struct/class mismatch in fwd declarations
115#endif
116
117namespace std
118{
119 template <class T> class allocator;
120 template <class charT, class traits, class Allocator> class basic_string;
121
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700122#if NDNBOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700123
124 template <class charT> struct string_char_traits;
125#else
126 template <class charT> struct char_traits;
127#endif
128
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700129#if defined(NDNBOOST_CONTAINER_FWD_COMPLEX_STRUCT)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700130 template <class T> struct complex;
131#else
132 template <class T> class complex;
133#endif
134
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700135#if !defined(NDNBOOST_CONTAINER_FWD_BAD_DEQUE)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700136 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 Thompson3d613fd2013-10-15 15:39:04 -0700147#if !defined(NDNBOOST_CONTAINER_FWD_BAD_BITSET)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700148 template <size_t N> class bitset;
149#endif
150 template <class T1, class T2> struct pair;
151}
152
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700153#if defined(NDNBOOST_MSVC)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700154#pragma warning(pop)
155#endif
156
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700157#endif // NDNBOOST_DETAIL_NO_CONTAINER_FWD &&
158 // !defined(NDNBOOST_DETAIL_TEST_FORCE_CONTAINER_FWD)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700159
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700160#endif // NDNBOOST_DETAIL_TEST_CONFIG_ONLY
Jeff Thompsona28eed82013-08-22 16:21:10 -0700161
162#endif