get a pointer value (explicit)
<nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value
decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>())
get() noexcept;
Explicit pointer access to the internally stored JSON value. No copies are made.
The pointer becomes invalid if the underlying JSON object changes.
Constant.
{The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a nullptr is returned if the value and the requested pointer type does not match.,get__PointerType}
nullptr otherwise
| Name | Description |
|---|---|
| PointerType | pointer type; must be a pointer to array_t, object_t, string_t, boolean_t, number_integer_t, number_unsigned_t, or number_float_t. |