container_fwd.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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 T1, class T2>
  81. struct pair;
  82. template<class T>
  83. class new_allocator;
  84. template <class T
  85. ,class Allocator = void
  86. ,class Options = void>
  87. class vector;
  88. template <class T
  89. ,class Allocator = void >
  90. class stable_vector;
  91. template < class T
  92. , std::size_t Capacity
  93. , class Options = void>
  94. class static_vector;
  95. template < class T
  96. , class Allocator = void
  97. , class Options = void >
  98. class small_vector_base;
  99. template < class T
  100. , std::size_t N
  101. , class Allocator = void
  102. , class Options = void >
  103. class small_vector;
  104. template <class T
  105. ,class Allocator = void
  106. ,class Options = void>
  107. class devector;
  108. template <class T
  109. ,class Allocator = void
  110. ,class Options = void>
  111. class deque;
  112. template <class T
  113. ,class Allocator = void >
  114. class list;
  115. template <class T
  116. ,class Allocator = void >
  117. class slist;
  118. template <class Key
  119. ,class Compare = std::less<Key>
  120. ,class Allocator = void
  121. ,class Options = void>
  122. class set;
  123. template <class Key
  124. ,class Compare = std::less<Key>
  125. ,class Allocator = void
  126. ,class Options = void >
  127. class multiset;
  128. template <class Key
  129. ,class T
  130. ,class Compare = std::less<Key>
  131. ,class Allocator = void
  132. ,class Options = void >
  133. class map;
  134. template <class Key
  135. ,class T
  136. ,class Compare = std::less<Key>
  137. ,class Allocator = void
  138. ,class Options = void >
  139. class multimap;
  140. template <class Key
  141. ,class Compare = std::less<Key>
  142. ,class Allocator = void >
  143. class flat_set;
  144. template <class Key
  145. ,class Compare = std::less<Key>
  146. ,class Allocator = void >
  147. class flat_multiset;
  148. template <class Key
  149. ,class T
  150. ,class Compare = std::less<Key>
  151. ,class Allocator = void >
  152. class flat_map;
  153. template <class Key
  154. ,class T
  155. ,class Compare = std::less<Key>
  156. ,class Allocator = void >
  157. class flat_multimap;
  158. #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
  159. //! Alias templates for small_flat_[multi]{set|map} using small_vector as container
  160. template < class Key
  161. , std::size_t N
  162. , class Compare = std::less<Key>
  163. , class SmallVectorAllocator = void
  164. , class SmallVectorOptions = void >
  165. using small_flat_set = flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>;
  166. template < class Key
  167. , std::size_t N
  168. , class Compare = std::less<Key>
  169. , class SmallVectorAllocator = void
  170. , class SmallVectorOptions = void >
  171. using small_flat_multiset = flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions>>;
  172. template < class Key
  173. , class T
  174. , std::size_t N
  175. , class Compare = std::less<Key>
  176. , class SmallVectorAllocator = void
  177. , class SmallVectorOptions = void >
  178. using small_flat_map = flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>;
  179. template < class Key
  180. , class T
  181. , std::size_t N
  182. , class Compare = std::less<Key>
  183. , class SmallVectorAllocator = void
  184. , class SmallVectorOptions = void >
  185. using small_flat_multimap = flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions>>;
  186. #endif // #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
  187. //! A portable metafunction to obtain a small_flat_set
  188. template < class Key
  189. , std::size_t N
  190. , class Compare = std::less<Key>
  191. , class SmallVectorAllocator = void
  192. , class SmallVectorOptions = void >
  193. struct small_flat_set_of
  194. {
  195. typedef flat_set<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type;
  196. };
  197. //! A portable metafunction to obtain a small_flat_multiset
  198. template < class Key
  199. , std::size_t N
  200. , class Compare = std::less<Key>
  201. , class SmallVectorAllocator = void
  202. , class SmallVectorOptions = void >
  203. struct small_flat_multiset_of
  204. {
  205. typedef flat_multiset<Key, Compare, small_vector<Key, N, SmallVectorAllocator, SmallVectorOptions> > type;
  206. };
  207. //! A portable metafunction to obtain a small_flat_map
  208. template < class Key
  209. , class T
  210. , std::size_t N
  211. , class Compare = std::less<Key>
  212. , class SmallVectorAllocator = void
  213. , class SmallVectorOptions = void >
  214. struct small_flat_map_of
  215. {
  216. typedef flat_map<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type;
  217. };
  218. //! A portable metafunction to obtain a small_flat_multimap
  219. template < class Key
  220. , class T
  221. , std::size_t N
  222. , class Compare = std::less<Key>
  223. , class SmallVectorAllocator = void
  224. , class SmallVectorOptions = void >
  225. struct small_flat_multimap_of
  226. {
  227. typedef flat_multimap<Key, T, Compare, small_vector<std::pair<Key, T>, N, SmallVectorAllocator, SmallVectorOptions> > type;
  228. };
  229. template <class CharT
  230. ,class Traits = std::char_traits<CharT>
  231. ,class Allocator = void >
  232. class basic_string;
  233. typedef basic_string <char> string;
  234. typedef basic_string<wchar_t> wstring;
  235. static const std::size_t ADP_nodes_per_block = 256u;
  236. static const std::size_t ADP_max_free_blocks = 2u;
  237. static const std::size_t ADP_overhead_percent = 1u;
  238. static const std::size_t ADP_only_alignment = 0u;
  239. template < class T
  240. , std::size_t NodesPerBlock = ADP_nodes_per_block
  241. , std::size_t MaxFreeBlocks = ADP_max_free_blocks
  242. , std::size_t OverheadPercent = ADP_overhead_percent
  243. , unsigned Version = 2
  244. >
  245. class adaptive_pool;
  246. template < class T
  247. , unsigned Version = 2
  248. , unsigned int AllocationDisableMask = 0>
  249. class allocator;
  250. static const std::size_t NodeAlloc_nodes_per_block = 256u;
  251. template
  252. < class T
  253. , std::size_t NodesPerBlock = NodeAlloc_nodes_per_block
  254. , std::size_t Version = 2>
  255. class node_allocator;
  256. namespace pmr {
  257. class memory_resource;
  258. template<class T>
  259. class polymorphic_allocator;
  260. class monotonic_buffer_resource;
  261. struct pool_options;
  262. template <class Allocator>
  263. class resource_adaptor_imp;
  264. class unsynchronized_pool_resource;
  265. class synchronized_pool_resource;
  266. } //namespace pmr {
  267. #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
  268. //! Type used to tag that the input range is
  269. //! guaranteed to be ordered
  270. struct ordered_range_t
  271. {};
  272. //! Value used to tag that the input range is
  273. //! guaranteed to be ordered
  274. static const ordered_range_t ordered_range = ordered_range_t();
  275. //! Type used to tag that the input range is
  276. //! guaranteed to be ordered and unique
  277. struct ordered_unique_range_t
  278. : public ordered_range_t
  279. {};
  280. //! Value used to tag that the input range is
  281. //! guaranteed to be ordered and unique
  282. static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
  283. //! Type used to tag that the inserted values
  284. //! should be default initialized
  285. struct default_init_t
  286. {};
  287. //! Value used to tag that the inserted values
  288. //! should be default initialized
  289. static const default_init_t default_init = default_init_t();
  290. #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
  291. //! Type used to tag that the inserted values
  292. //! should be value initialized
  293. struct value_init_t
  294. {};
  295. //! Value used to tag that the inserted values
  296. //! should be value initialized
  297. static const value_init_t value_init = value_init_t();
  298. namespace container_detail_really_deep_namespace {
  299. //Otherwise, gcc issues a warning of previously defined
  300. //anonymous_instance and unique_instance
  301. struct dummy
  302. {
  303. dummy()
  304. {
  305. (void)ordered_range;
  306. (void)ordered_unique_range;
  307. (void)default_init;
  308. }
  309. };
  310. } //detail_really_deep_namespace {
  311. #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
  312. }} //namespace boost { namespace container {
  313. #endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP