memory_resource.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/json
  8. //
  9. #ifndef BOOST_JSON_MEMORY_RESOURCE_HPP
  10. #define BOOST_JSON_MEMORY_RESOURCE_HPP
  11. #include <boost/json/detail/config.hpp>
  12. #include <boost/container/pmr/memory_resource.hpp>
  13. #include <boost/container/pmr/polymorphic_allocator.hpp>
  14. #include <boost/json/is_deallocate_trivial.hpp>
  15. namespace boost {
  16. namespace json {
  17. /** The type of memory resource used by the library.
  18. @note This alias is deprecated in favor of
  19. `boost::container::pmr::memory_resource`. It is included for backwards
  20. compatibility and shouldn't be used in new code. It will be removed
  21. completely in version 1.87.0.
  22. */
  23. typedef boost::container::pmr::memory_resource
  24. BOOST_JSON_DEPRECATED("Use boost::container::pmr::memory_resource instead")
  25. memory_resource;
  26. /** The type of polymorphic allocator used by the library.
  27. @note This alias is deprecated in favor of
  28. `boost::container::pmr::polymorphic_allocator`. It is included for
  29. backwards compatibility and shouldn't be used in new code. It will be
  30. removed completely in version 1.87.0.
  31. */
  32. template<class T>
  33. using
  34. polymorphic_allocator
  35. #ifndef BOOST_MSVC
  36. BOOST_JSON_DEPRECATED("Use boost::container::pmr::polymorphic_allocator instead")
  37. #endif
  38. = boost::container::pmr::polymorphic_allocator<T>;
  39. } // namespace json
  40. } // namespace boost
  41. #endif