Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 127294d48b.
PrevUpHomeNext
value::set_at_pointer (3 of 3 overloads)

Set an element via JSON Pointer.

Synopsis
value&
set_at_pointer(
    string_view sv,
    value_ref ref,
    set_pointer_options const& opts = {});
Description

This function is used to insert or assign to a potentially nested element of the value using a JSON Pointer string. The function may create intermediate elements corresponding to pointer segments.

The particular conditions when and what kind of intermediate element is created is governed by the ptr parameter. Each pointer token is considered in sequence. For each token

Complexity

Linear in the sum of size of ptr, size of underlying array, object, or string and opts.max_created_elements.

Exception Safety

Basic guarantee. Calls to memory_resource::allocate may throw.

Parameters

Name

Description

sv

JSON Pointer string.

ref

The value to assign to pointed element.

opts

The options for the algorithm.

Return Value

Reference to the element identified by ptr.

See Also

set_pointer_options, RFC 6901 - JavaScript Object Notation (JSON) Pointer.


PrevUpHomeNext