1 ////////////////////////////////////////////////////////////////////////////// 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_base 28 //! - boost::container::small_vector 29 //! - boost::container::devector 30 //! - boost::container::slist 31 //! - boost::container::list 32 //! - boost::container::set 33 //! - boost::container::multiset 34 //! - boost::container::map 35 //! - boost::container::multimap 36 //! - boost::container::flat_set 37 //! - boost::container::flat_multiset 38 //! - boost::container::flat_map 39 //! - boost::container::flat_multimap 40 //! - boost::container::basic_string 41 //! - boost::container::string 42 //! - boost::container::wstring 43 //! 44 //! Forward declares the following allocators: 45 //! - boost::container::allocator 46 //! - boost::container::node_allocator 47 //! - boost::container::adaptive_pool 48 //! 49 //! Forward declares the following polymorphic resource classes: 50 //! - boost::container::pmr::memory_resource 51 //! - boost::container::pmr::polymorphic_allocator 52 //! - boost::container::pmr::monotonic_buffer_resource 53 //! - boost::container::pmr::pool_options 54 //! - boost::container::pmr::unsynchronized_pool_resource 55 //! - boost::container::pmr::synchronized_pool_resource 56 //! 57 //! And finally it defines the following types 58 59 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 60 61 //Std forward declarations 62 #ifndef BOOST_CONTAINER_DETAIL_STD_FWD_HPP 63 #include <boost/container/detail/std_fwd.hpp> 64 #endif 65 66 namespace boost{ 67 namespace intrusive{ 68 namespace detail{ 69 //Create namespace to avoid compilation errors 70 }}} 71 72 namespace boost{ namespace container{ namespace dtl{ 73 namespace bi = boost::intrusive; 74 namespace bid = boost::intrusive::detail; 75 }}} 76 77 namespace boost{ namespace container{ namespace pmr{ 78 namespace bi = boost::intrusive; 79 namespace bid = boost::intrusive::detail; 80 }}} 81 82 #include <cstddef> 83 84 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 85 86 ////////////////////////////////////////////////////////////////////////////// 87 // Containers 88 ////////////////////////////////////////////////////////////////////////////// 89 90 namespace boost { 91 namespace container { 92 93 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 94 95 template<class T1, class T2> 96 struct pair; 97 98 template<class T> 99 class new_allocator; 100 101 template <class T 102 ,class Allocator = void 103 ,class Options = void> 104 class vector; 105 106 template <class T 107 ,class Allocator = void > 108 class stable_vector; 109 110 template < class T 111 , std::size_t Capacity 112 , class Options = void> 113 class static_vector; 114 115 template < class T 116 , class Allocator = void 117 , class Options = void > 118 class small_vector_base; 119 120 template < class T 121 , std::size_t N 122 , class Allocator = void 123 , class Options = void > 124 class small_vector; 125 126 template <class T 127 ,class Allocator = void 128 ,class Options = void> 129 class devector; 130 131 template <class T 132 ,class Allocator = void 133 ,class Options = void> 134 class deque; 135 136 template <class T 137 ,class Allocator = void > 138 class list; 139 140 template <class T 141 ,class Allocator = void > 142 class slist; 143 144 template <class Key 145 ,class Compare = std::less<Key> 146 ,class Allocator = void 147 ,class Options = void> 148 class set; 149 150 template <class Key 151 ,class Compare = std::less<Key> 152 ,class Allocator = void 153 ,class Options = void > 154 class multiset; 155 156 template <class Key 157 ,class T 158 ,class Compare = std::less<Key> 159 ,class Allocator = void 160 ,class Options = void > 161 class map; 162 163 template <class Key 164 ,class T 165 ,class Compare = std::less<Key> 166 ,class Allocator = void 167 ,class Options = void > 168 class multimap; 169 170 template <class Key 171 ,class Compare = std::less<Key> 172 ,class Allocator = void > 173 class flat_set; 174 175 template <class Key 176 ,class Compare = std::less<Key> 177 ,class Allocator = void > 178 class flat_multiset; 179 180 template <class Key 181 ,class T 182 ,class Compare = std::less<Key> 183 ,class Allocator = void > 184 class flat_map; 185 186 template <class Key 187 ,class T 188 ,class Compare = std::less<Key> 189 ,class Allocator = void > 190 class flat_multimap; 191 192 #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES 193 194 //! Alias templates for small_flat_[multi]{set|map} using small_vector as container 195 196 template < class Key 197 , std::size_t N 198 , class Compare = std::less<Key> 199 , class SmallVectorAllocator = void 200 , class SmallVectorOptions = void > 201 using small_flat_set = flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>; 202 203 template < class Key 204 , std::size_t N 205 , class Compare = std::less<Key> 206 , class SmallVectorAllocator = void 207 , class SmallVectorOptions = void > 208 using small_flat_multiset = flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>; 209 210 template < class Key 211 , class T 212 , std::size_t N 213 , class Compare = std::less<Key> 214 , class SmallVectorAllocator = void 215 , class SmallVectorOptions = void > 216 using small_flat_map = flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>; 217 218 template < class Key 219 , class T 220 , std::size_t N 221 , class Compare = std::less<Key> 222 , class SmallVectorAllocator = void 223 , class SmallVectorOptions = void > 224 using small_flat_multimap = flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>; 225 226 #endif // #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES 227 228 229 //! A portable metafunction to obtain a small_flat_set 230 template < class Key 231 , std::size_t N 232 , class Compare = std::less<Key> 233 , class SmallVectorAllocator = void 234 , class SmallVectorOptions = void > 235 struct small_flat_set_of 236 { 237 typedef flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type; 238 }; 239 240 //! A portable metafunction to obtain a small_flat_multiset 241 template < class Key 242 , std::size_t N 243 , class Compare = std::less<Key> 244 , class SmallVectorAllocator = void 245 , class SmallVectorOptions = void > 246 struct small_flat_multiset_of 247 { 248 typedef flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type; 249 }; 250 251 //! A portable metafunction to obtain a small_flat_map 252 template < class Key 253 , class T 254 , std::size_t N 255 , class Compare = std::less<Key> 256 , class SmallVectorAllocator = void 257 , class SmallVectorOptions = void > 258 struct small_flat_map_of 259 { 260 typedef flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type; 261 }; 262 263 //! A portable metafunction to obtain a small_flat_multimap 264 template < class Key 265 , class T 266 , std::size_t N 267 , class Compare = std::less<Key> 268 , class SmallVectorAllocator = void 269 , class SmallVectorOptions = void > 270 struct small_flat_multimap_of 271 { 272 typedef flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type; 273 }; 274 275 template <class CharT 276 ,class Traits = std::char_traits<CharT> 277 ,class Allocator = void > 278 class basic_string; 279 280 typedef basic_string <char> string; 281 typedef basic_string<wchar_t> wstring; 282 283 static const std::size_t ADP_nodes_per_block = 256u; 284 static const std::size_t ADP_max_free_blocks = 2u; 285 static const std::size_t ADP_overhead_percent = 1u; 286 static const std::size_t ADP_only_alignment = 0u; 287 288 template < class T 289 , std::size_t NodesPerBlock = ADP_nodes_per_block 290 , std::size_t MaxFreeBlocks = ADP_max_free_blocks 291 , std::size_t OverheadPercent = ADP_overhead_percent 292 , unsigned Version = 2 293 > 294 class adaptive_pool; 295 296 template < class T 297 , unsigned Version = 2 298 , unsigned int AllocationDisableMask = 0> 299 class allocator; 300 301 static const std::size_t NodeAlloc_nodes_per_block = 256u; 302 303 template 304 < class T 305 , std::size_t NodesPerBlock = NodeAlloc_nodes_per_block 306 , std::size_t Version = 2> 307 class node_allocator; 308 309 namespace pmr { 310 311 class memory_resource; 312 313 template<class T> 314 class polymorphic_allocator; 315 316 class monotonic_buffer_resource; 317 318 struct pool_options; 319 320 template <class Allocator> 321 class resource_adaptor_imp; 322 323 class unsynchronized_pool_resource; 324 325 class synchronized_pool_resource; 326 327 } //namespace pmr { 328 329 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 330 331 //! Type used to tag that the input range is 332 //! guaranteed to be ordered 333 struct ordered_range_t 334 {}; 335 336 //! Value used to tag that the input range is 337 //! guaranteed to be ordered 338 static const ordered_range_t ordered_range = ordered_range_t(); 339 340 //! Type used to tag that the input range is 341 //! guaranteed to be ordered and unique 342 struct ordered_unique_range_t 343 : public ordered_range_t 344 {}; 345 346 //! Value used to tag that the input range is 347 //! guaranteed to be ordered and unique 348 static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t(); 349 350 //! Type used to tag that the inserted values 351 //! should be default initialized 352 struct default_init_t 353 {}; 354 355 //! Value used to tag that the inserted values 356 //! should be default initialized 357 static const default_init_t default_init = default_init_t(); 358 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 359 360 //! Type used to tag that the inserted values 361 //! should be value initialized 362 struct value_init_t 363 {}; 364 365 //! Value used to tag that the inserted values 366 //! should be value initialized 367 static const value_init_t value_init = value_init_t(); 368 369 namespace container_detail_really_deep_namespace { 370 371 //Otherwise, gcc issues a warning of previously defined 372 //anonymous_instance and unique_instance 373 struct dummy 374 { dummyboost::container::container_detail_really_deep_namespace::dummy375 dummy() 376 { 377 (void)ordered_range; 378 (void)ordered_unique_range; 379 (void)default_init; 380 } 381 }; 382 383 } //detail_really_deep_namespace { 384 385 386 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED 387 388 }} //namespace boost { namespace container { 389 390 #endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP 391