mirror of
https://github.com/boostorg/json.git
synced 2026-02-10 23:42:19 +00:00
Refactor memory resource includes
This commit is contained in:
@@ -20,13 +20,9 @@ namespace json {
|
||||
/// The type of string view used by the library.
|
||||
using string_view = boost::string_view;
|
||||
|
||||
/// The type of memory_resource used by the library.
|
||||
using memory_resource = boost::container::pmr::memory_resource;
|
||||
|
||||
#else
|
||||
|
||||
using string_view = std::string_view;
|
||||
using memory_resource = std::pmr::memory_resource;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -13,12 +13,10 @@
|
||||
#ifndef BOOST_JSON_STANDALONE
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/assert.hpp>
|
||||
# include <boost/container/pmr/memory_resource.hpp>
|
||||
# include <boost/utility/string_view.hpp>
|
||||
# include <boost/throw_exception.hpp>
|
||||
#else
|
||||
# include <cassert>
|
||||
# include <memory_resource>
|
||||
# include <string_view>
|
||||
#endif
|
||||
#include <cstdint>
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
#ifndef BOOST_JSON_DETAIL_COUNTED_RESOURCE_HPP
|
||||
#define BOOST_JSON_DETAIL_COUNTED_RESOURCE_HPP
|
||||
|
||||
#include <boost/json/config.hpp>
|
||||
#include <boost/json/memory_resource.hpp>
|
||||
#include <atomic>
|
||||
#include <utility>
|
||||
|
||||
namespace boost {
|
||||
namespace json {
|
||||
|
||||
37
include/boost/json/memory_resource.hpp
Normal file
37
include/boost/json/memory_resource.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Official repository: https://github.com/vinniefalco/json
|
||||
//
|
||||
|
||||
#ifndef BOOST_JSON_MEMORY_RESOURCE_HPP
|
||||
#define BOOST_JSON_MEMORY_RESOURCE_HPP
|
||||
|
||||
#include <boost/json/config.hpp>
|
||||
#ifndef BOOST_JSON_STANDALONE
|
||||
# include <boost/container/pmr/memory_resource.hpp>
|
||||
#else
|
||||
# include <memory_resource>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace json {
|
||||
|
||||
#ifndef BOOST_JSON_STANDALONE
|
||||
|
||||
/// The type of memory_resource used by the library.
|
||||
using memory_resource = boost::container::pmr::memory_resource;
|
||||
|
||||
#else
|
||||
|
||||
using memory_resource = std::pmr::memory_resource;
|
||||
|
||||
#endif
|
||||
|
||||
} // json
|
||||
} // boost
|
||||
|
||||
#endif
|
||||
@@ -11,6 +11,7 @@
|
||||
#define BOOST_JSON_STORAGE_PTR_HPP
|
||||
|
||||
#include <boost/json/config.hpp>
|
||||
#include <boost/json/memory_resource.hpp>
|
||||
#include <boost/json/detail/counted_resource.hpp>
|
||||
#include <boost/json/detail/default_resource.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
Reference in New Issue
Block a user