mirror of
https://github.com/nlohmann/json.git
synced 2026-07-09 12:05:10 +00:00
32 lines
502 B
Markdown
32 lines
502 B
Markdown
# <small>nlohmann::basic_json::</small>get_allocator
|
|
|
|
```cpp
|
|
static allocator_type get_allocator();
|
|
```
|
|
|
|
Returns the allocator associated with the container.
|
|
|
|
## Return value
|
|
|
|
associated allocator
|
|
|
|
## Examples
|
|
|
|
??? example
|
|
|
|
The example shows how `get_allocator()` is used to created `json` values.
|
|
|
|
```cpp
|
|
--8<-- "examples/get_allocator.cpp"
|
|
```
|
|
|
|
Output:
|
|
|
|
```json
|
|
--8<-- "examples/get_allocator.output"
|
|
```
|
|
|
|
## Version history
|
|
|
|
- Added in version 1.0.0.
|