File indexing completed on 2025-01-18 09:38:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_JSON_DETAIL_IMPL_DEFAULT_RESOURCE_IPP
0011 #define BOOST_JSON_DETAIL_IMPL_DEFAULT_RESOURCE_IPP
0012
0013 #include <boost/json/detail/default_resource.hpp>
0014
0015 namespace boost {
0016 namespace json {
0017 namespace detail {
0018
0019 #ifndef BOOST_JSON_WEAK_CONSTINIT
0020 # ifndef BOOST_JSON_NO_DESTROY
0021 BOOST_JSON_REQUIRE_CONST_INIT
0022 default_resource::holder
0023 default_resource::instance_;
0024 # else
0025 BOOST_JSON_REQUIRE_CONST_INIT
0026 default_resource
0027 default_resource::instance_;
0028 # endif
0029 #endif
0030
0031
0032
0033
0034 default_resource::
0035 ~default_resource() = default;
0036
0037 void*
0038 default_resource::
0039 do_allocate(
0040 std::size_t n,
0041 std::size_t)
0042 {
0043 return ::operator new(n);
0044 }
0045
0046 void
0047 default_resource::
0048 do_deallocate(
0049 void* p,
0050 std::size_t,
0051 std::size_t)
0052 {
0053 ::operator delete(p);
0054 }
0055
0056 bool
0057 default_resource::
0058 do_is_equal(
0059 memory_resource const& mr) const noexcept
0060 {
0061 return this == &mr;
0062 }
0063
0064 }
0065 }
0066 }
0067
0068 #endif