map.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2015-2015. 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_PMR_MAP_HPP
  11. #define BOOST_CONTAINER_PMR_MAP_HPP
  12. #if defined (_MSC_VER)
  13. # pragma once
  14. #endif
  15. #include <boost/container/map.hpp>
  16. #include <boost/container/pmr/polymorphic_allocator.hpp>
  17. namespace boost {
  18. namespace container {
  19. namespace pmr {
  20. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  21. template <class Key
  22. ,class T
  23. ,class Compare = std::less<Key>
  24. ,class Options = void >
  25. using map = boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>;
  26. template <class Key
  27. ,class T
  28. ,class Compare = std::less<Key>
  29. ,class Options = void >
  30. using multimap = boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options>;
  31. #endif
  32. //! A portable metafunction to obtain a map
  33. //! that uses a polymorphic allocator
  34. template <class Key
  35. ,class T
  36. ,class Compare = std::less<Key>
  37. ,class Options = void >
  38. struct map_of
  39. {
  40. typedef boost::container::map<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type;
  41. };
  42. //! A portable metafunction to obtain a multimap
  43. //! that uses a polymorphic allocator
  44. template <class Key
  45. ,class T
  46. ,class Compare = std::less<Key>
  47. ,class Options = void >
  48. struct multimap_of
  49. {
  50. typedef boost::container::multimap<Key, T, Compare, polymorphic_allocator<std::pair<const Key, T> >, Options> type;
  51. };
  52. } //namespace pmr {
  53. } //namespace container {
  54. } //namespace boost {
  55. #endif //BOOST_CONTAINER_PMR_MAP_HPP