set.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_SET_HPP
  11. #define BOOST_CONTAINER_PMR_SET_HPP
  12. #if defined (_MSC_VER)
  13. # pragma once
  14. #endif
  15. #include <boost/container/set.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 Compare = std::less<Key>
  23. ,class Options = void >
  24. using set = boost::container::set<Key, Compare, polymorphic_allocator<Key>, Options>;
  25. template <class Key
  26. ,class Compare = std::less<Key>
  27. ,class Options = void >
  28. using multiset = boost::container::multiset<Key, Compare, polymorphic_allocator<Key>, Options>;
  29. #endif
  30. //! A portable metafunction to obtain a set
  31. //! that uses a polymorphic allocator
  32. template <class Key
  33. ,class Compare = std::less<Key>
  34. ,class Options = void >
  35. struct set_of
  36. {
  37. typedef boost::container::set<Key, Compare, polymorphic_allocator<Key>, Options> type;
  38. };
  39. //! A portable metafunction to obtain a multiset
  40. //! that uses a polymorphic allocator
  41. template <class Key
  42. ,class Compare = std::less<Key>
  43. ,class Options = void >
  44. struct multiset_of
  45. {
  46. typedef boost::container::multiset<Key, Compare, polymorphic_allocator<Key>, Options> type;
  47. };
  48. } //namespace pmr {
  49. } //namespace container {
  50. } //namespace boost {
  51. #endif //BOOST_CONTAINER_PMR_SET_HPP