devector.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_VECTOR_HPP
  11. #define BOOST_CONTAINER_PMR_VECTOR_HPP
  12. #if defined (_MSC_VER)
  13. # pragma once
  14. #endif
  15. #include <boost/container/devector.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 <
  22. typename T,
  23. typename Options = void
  24. >
  25. using devector = boost::container::devector<T, polymorphic_allocator<T>, Options >;
  26. #endif
  27. //! A portable metafunction to obtain a vector
  28. //! that uses a polymorphic allocator
  29. template <
  30. typename T,
  31. typename Options = void
  32. >
  33. struct devector_of
  34. {
  35. typedef boost::container::devector
  36. < T
  37. , polymorphic_allocator<T>
  38. , Options > type;
  39. };
  40. } //namespace pmr {
  41. } //namespace container {
  42. } //namespace boost {
  43. #endif //BOOST_CONTAINER_PMR_VECTOR_HPP