container_fwd.hpp 11 KB

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