blob: e4fe6f85c3706a80299dc5af5c6309afd943619f [file] [log] [blame]
Brian Silvermanfad8f552018-08-04 23:36:19 -07001//////////////////////////////////////////////////////////////////////////////
2//
3// (C) Copyright Ion Gaztanaga 2005-2014. Distributed under the Boost
4// Software License, Version 1.0. (See accompanying file
5// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6//
7// See http://www.boost.org/libs/container for documentation.
8//
9//////////////////////////////////////////////////////////////////////////////
10
11#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP
12#define BOOST_CONTAINER_CONTAINER_FWD_HPP
13
14#ifndef BOOST_CONFIG_HPP
15# include <boost/config.hpp>
16#endif
17
18#if defined(BOOST_HAS_PRAGMA_ONCE)
19# pragma once
20#endif
21
22//! \file
23//! This header file forward declares the following containers:
24//! - boost::container::vector
25//! - boost::container::stable_vector
26//! - boost::container::static_vector
27//! - boost::container::small_vector
28//! - boost::container::slist
29//! - boost::container::list
30//! - boost::container::set
31//! - boost::container::multiset
32//! - boost::container::map
33//! - boost::container::multimap
34//! - boost::container::flat_set
35//! - boost::container::flat_multiset
36//! - boost::container::flat_map
37//! - boost::container::flat_multimap
38//! - boost::container::basic_string
39//! - boost::container::string
40//! - boost::container::wstring
41//!
42//! Forward declares the following allocators:
43//! - boost::container::allocator
44//! - boost::container::node_allocator
45//! - boost::container::adaptive_pool
46//!
47//! Forward declares the following polymorphic resource classes:
48//! - boost::container::pmr::memory_resource
49//! - boost::container::pmr::polymorphic_allocator
50//! - boost::container::pmr::monotonic_buffer_resource
51//! - boost::container::pmr::pool_options
52//! - boost::container::pmr::unsynchronized_pool_resource
53//! - boost::container::pmr::synchronized_pool_resource
54//!
55//! And finally it defines the following types
56
57#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
58
59//Std forward declarations
60#ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP
61 #include <boost/container/detail/std_fwd.hpp>
62#endif
63
64namespace boost{
65namespace intrusive{
66namespace detail{
67 //Create namespace to avoid compilation errors
68}}}
69
70namespace boost{ namespace container{ namespace dtl{
71 namespace bi = boost::intrusive;
72 namespace bid = boost::intrusive::detail;
73}}}
74
75namespace boost{ namespace container{ namespace pmr{
76 namespace bi = boost::intrusive;
77 namespace bid = boost::intrusive::detail;
78}}}
79
80#include <cstddef>
81
82#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
83
84//////////////////////////////////////////////////////////////////////////////
85// Containers
86//////////////////////////////////////////////////////////////////////////////
87
88namespace boost {
89namespace container {
90
91#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
92
93template<class T>
94class new_allocator;
95
96template <class T
97 ,class Allocator = new_allocator<T>
98 ,class Options = void>
99class vector;
100
101template <class T
102 ,class Allocator = new_allocator<T> >
103class stable_vector;
104
105template <class T, std::size_t Capacity>
106class static_vector;
107
108template < class T, std::size_t N
109 , class Allocator= new_allocator<T> >
110class small_vector;
111
112template <class T
113 ,class Allocator = new_allocator<T> >
114class deque;
115
116template <class T
117 ,class Allocator = new_allocator<T> >
118class list;
119
120template <class T
121 ,class Allocator = new_allocator<T> >
122class slist;
123
124template <class Key
125 ,class Compare = std::less<Key>
126 ,class Allocator = new_allocator<Key>
127 ,class Options = void>
128class set;
129
130template <class Key
131 ,class Compare = std::less<Key>
132 ,class Allocator = new_allocator<Key>
133 ,class Options = void >
134class multiset;
135
136template <class Key
137 ,class T
138 ,class Compare = std::less<Key>
139 ,class Allocator = new_allocator<std::pair<const Key, T> >
140 ,class Options = void >
141class map;
142
143template <class Key
144 ,class T
145 ,class Compare = std::less<Key>
146 ,class Allocator = new_allocator<std::pair<const Key, T> >
147 ,class Options = void >
148class multimap;
149
150template <class Key
151 ,class Compare = std::less<Key>
152 ,class Allocator = new_allocator<Key> >
153class flat_set;
154
155template <class Key
156 ,class Compare = std::less<Key>
157 ,class Allocator = new_allocator<Key> >
158class flat_multiset;
159
160template <class Key
161 ,class T
162 ,class Compare = std::less<Key>
163 ,class Allocator = new_allocator<std::pair<Key, T> > >
164class flat_map;
165
166template <class Key
167 ,class T
168 ,class Compare = std::less<Key>
169 ,class Allocator = new_allocator<std::pair<Key, T> > >
170class flat_multimap;
171
172template <class CharT
173 ,class Traits = std::char_traits<CharT>
174 ,class Allocator = new_allocator<CharT> >
175class basic_string;
176
177typedef basic_string
178 <char
179 ,std::char_traits<char>
180 ,new_allocator<char> >
181string;
182
183typedef basic_string
184 <wchar_t
185 ,std::char_traits<wchar_t>
186 ,new_allocator<wchar_t> >
187wstring;
188
189static const std::size_t ADP_nodes_per_block = 256u;
190static const std::size_t ADP_max_free_blocks = 2u;
191static const std::size_t ADP_overhead_percent = 1u;
192static const std::size_t ADP_only_alignment = 0u;
193
194template < class T
195 , std::size_t NodesPerBlock = ADP_nodes_per_block
196 , std::size_t MaxFreeBlocks = ADP_max_free_blocks
197 , std::size_t OverheadPercent = ADP_overhead_percent
198 , unsigned Version = 2
199 >
200class adaptive_pool;
201
202template < class T
203 , unsigned Version = 2
204 , unsigned int AllocationDisableMask = 0>
205class allocator;
206
207static const std::size_t NodeAlloc_nodes_per_block = 256u;
208
209template
210 < class T
211 , std::size_t NodesPerBlock = NodeAlloc_nodes_per_block
212 , std::size_t Version = 2>
213class node_allocator;
214
215namespace pmr {
216
217class memory_resource;
218
219template<class T>
220class polymorphic_allocator;
221
222class monotonic_buffer_resource;
223
224struct pool_options;
225
226template <class Allocator>
227class resource_adaptor_imp;
228
229class unsynchronized_pool_resource;
230
231class synchronized_pool_resource;
232
233} //namespace pmr {
234
235#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
236
237//! Type used to tag that the input range is
238//! guaranteed to be ordered
239struct ordered_range_t
240{};
241
242//! Value used to tag that the input range is
243//! guaranteed to be ordered
244static const ordered_range_t ordered_range = ordered_range_t();
245
246//! Type used to tag that the input range is
247//! guaranteed to be ordered and unique
248struct ordered_unique_range_t
249 : public ordered_range_t
250{};
251
252//! Value used to tag that the input range is
253//! guaranteed to be ordered and unique
254static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
255
256//! Type used to tag that the inserted values
257//! should be default initialized
258struct default_init_t
259{};
260
261//! Value used to tag that the inserted values
262//! should be default initialized
263static const default_init_t default_init = default_init_t();
264#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
265
266//! Type used to tag that the inserted values
267//! should be value initialized
268struct value_init_t
269{};
270
271//! Value used to tag that the inserted values
272//! should be value initialized
273static const value_init_t value_init = value_init_t();
274
275namespace container_detail_really_deep_namespace {
276
277//Otherwise, gcc issues a warning of previously defined
278//anonymous_instance and unique_instance
279struct dummy
280{
281 dummy()
282 {
283 (void)ordered_range;
284 (void)ordered_unique_range;
285 (void)default_init;
286 }
287};
288
289} //detail_really_deep_namespace {
290
291
292#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
293
294}} //namespace boost { namespace container {
295
296#endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP