123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- #ifndef BOOST_JSON_MEMORY_RESOURCE_HPP
- #define BOOST_JSON_MEMORY_RESOURCE_HPP
- #include <boost/json/detail/config.hpp>
- #ifdef BOOST_JSON_STANDALONE
- # if __has_include(<memory_resource>)
- # include <memory_resource>
- # ifndef __cpp_lib_memory_resource
- # error Support for std::memory_resource is required to use Boost.JSON standalone
- # endif
- # elif __has_include(<experimental/memory_resource>)
- # include <experimental/memory_resource>
- # warning Support for std::memory_resource is required to use Boost.JSON standalone, using std::experimental::memory_resource as fallback
- # else
- # error Header <memory_resource> is required to use Boost.JSON standalone
- # endif
- #else
- # include <boost/container/pmr/memory_resource.hpp>
- # include <boost/container/pmr/polymorphic_allocator.hpp>
- #endif
- BOOST_JSON_NS_BEGIN
- #ifdef BOOST_JSON_DOCS
- class memory_resource
- {
- };
- template<class T>
- class polymorphic_allocator;
- #elif defined(BOOST_JSON_STANDALONE)
- # if __has_include(<memory_resource>)
- using memory_resource = std::pmr::memory_resource;
- template<class T>
- using polymorphic_allocator =
- std::pmr::polymorphic_allocator<T>;
- # else
- using memory_resource = std::experimental::pmr::memory_resource;
- template<class T>
- using polymorphic_allocator =
- std::experimental::pmr::polymorphic_allocator<T>;
- # endif
- #else
- using memory_resource = boost::container::pmr::memory_resource;
- template<class T>
- using polymorphic_allocator =
- boost::container::pmr::polymorphic_allocator<T>;
- #endif
- template<class T>
- struct is_deallocate_trivial
- {
-
- static constexpr bool value = false;
- };
- BOOST_JSON_NS_END
- #endif
|