map.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright (C) 2005-2016 Daniel James
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/unordered/detail/implementation.hpp>
  5. #include <boost/unordered/unordered_map_fwd.hpp>
  6. namespace boost {
  7. namespace unordered {
  8. namespace detail {
  9. template <typename A, typename K, typename M, typename H, typename P>
  10. struct map
  11. {
  12. typedef boost::unordered::detail::map<A, K, M, H, P> types;
  13. typedef std::pair<K const, M> value_type;
  14. typedef H hasher;
  15. typedef P key_equal;
  16. typedef K const const_key_type;
  17. typedef
  18. typename ::boost::unordered::detail::rebind_wrap<A, value_type>::type
  19. value_allocator;
  20. typedef boost::unordered::detail::allocator_traits<value_allocator>
  21. value_allocator_traits;
  22. typedef boost::unordered::detail::pick_node<A, value_type> pick;
  23. typedef typename pick::node node;
  24. typedef typename pick::bucket bucket;
  25. typedef typename pick::link_pointer link_pointer;
  26. typedef boost::unordered::detail::table<types> table;
  27. typedef boost::unordered::detail::map_extractor<value_type> extractor;
  28. typedef typename boost::unordered::detail::pick_policy<K>::type policy;
  29. typedef boost::unordered::iterator_detail::iterator<node> iterator;
  30. typedef boost::unordered::iterator_detail::c_iterator<node> c_iterator;
  31. typedef boost::unordered::iterator_detail::l_iterator<node> l_iterator;
  32. typedef boost::unordered::iterator_detail::cl_iterator<node>
  33. cl_iterator;
  34. typedef boost::unordered::node_handle_map<node, K, M, A> node_type;
  35. typedef boost::unordered::insert_return_type_map<node, K, M, A>
  36. insert_return_type;
  37. };
  38. template <typename K, typename M, typename H, typename P, typename A>
  39. class instantiate_map
  40. {
  41. typedef boost::unordered_map<K, M, H, P, A> container;
  42. container x;
  43. typename container::node_type node_type;
  44. typename container::insert_return_type insert_return_type;
  45. };
  46. template <typename K, typename M, typename H, typename P, typename A>
  47. class instantiate_multimap
  48. {
  49. typedef boost::unordered_multimap<K, M, H, P, A> container;
  50. container x;
  51. typename container::node_type node_type;
  52. };
  53. }
  54. }
  55. }