Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Oct 23, 2024
1 parent 2cec7fc commit 9b208c0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions doc/ref/corelib/json/allocators.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ that it is allocator aware. `Allocator` must be a Scoped Allocator, that is, an
that applies not only to a `basic_json`'s data member, but also to its data member's elements.
In particular, `Allocator` must be either a stateless allocator,
a <a href=https://en.cppreference.com/w/cpp/memory/polymorphic_allocator>std::pmr::polymorphic_allocator</a>,
or a <a href=https://en.cppreference.com/w/cpp/memory/scoped_allocator_adaptor>std::scoped_allocator_adaptor</a>, see <a href=json/allocators.md>allocators</a>.
or a <a href=https://en.cppreference.com/w/cpp/memory/scoped_allocator_adaptor>std::scoped_allocator_adaptor</a>.
Non-propagating stateful allocators, such as the [Boost.Interprocess allocators](https://www.boost.org/doc/libs/1_82_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.allocator_introduction),
must be wrapped by a [std::scoped_allocator_adaptor](https://en.cppreference.com/w/cpp/memory/scoped_allocator_adaptor).

Every constructor has a version that can be invoked with an allocator argument.
This argument is used to allocate memory for a long string, byte string, array, or object.
In the case of scalars, it is ignored.

Scoped Allocators are allocators that apply not only to the top-level container, but also to its elements

#### https://en.cppreference.com/w/cpp/memory/polymorphic_allocator


#### std::scoped_allocator_adaptor

Non-propagating stateful allocators, such as the [Boost.Interprocess allocators](https://www.boost.org/doc/libs/1_82_0/doc/html/interprocess/allocators_containers.html#interprocess.allocators_containers.allocator_introduction),
must be wrapped by a [std::scoped_allocator_adaptor](https://en.cppreference.com/w/cpp/memory/scoped_allocator_adaptor).

0 comments on commit 9b208c0

Please sign in to comment.