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