parsers::json::Node
The dynamic JSON value: a thin class wrapping a std::variant over the token types (Null, Boolean, Number, owning/viewing String, Array, Object).
There is no runtime polymorphism — dispatch is compile-time std::visit over variant(); the class exists to be forward-declarable so Array/Object can be templated on their storage type.
Functions
Node · 2 overloads
Construct from any one of the token alternatives (e.g.
Number{3.5}); excludes Node itself so the copy/move constructors are not hidden.
T | one of the variant alternative types. |
value | the token value to store (forwarded into the variant). |
O(1) — one move/copy of the token into the variant.
none of its own (whatever the moved-in token owns comes along).
variant · 2 overloads
variant_type & variant() noexceptsource#const variant_type & variant() const noexceptsource#The underlying variant, for dispatch with std::visit / std::get / std::get_if / emplace.
a mutable reference to the wrapped variant.
O(1).
none.
Constants & variables
Types
std::variant< Null, Boolean, Number, String< std::string_view >, String< std::string >, ArrayView, OwnedArray, ObjectView, OwnedObject > variant_type
source#
The set of JSON value alternatives this Node may hold (null is the first, default state).
