[#nlohmann-basic_json-0e-get-0e]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0e.adoc[basic&lowbar;json&lt;&gt;]::get
:relfileprefix: ../../
:mrdocs:

get a pointer value (explicit)

== Synopsis

Declared in `&lt;nlohmann&sol;json&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename PointerType&gt;
requires std&colon;&colon;is&lowbar;pointer&lt;PointerType&gt;&colon;&colon;value
decltype(std&colon;&colon;declval&lt;basic&lowbar;json&lowbar;t&amp;&gt;()&period;template get&lowbar;ptr&lt;PointerType&gt;())
get() noexcept;
----

== Description

Explicit pointer access to the internally stored JSON value&period; No copies are made&period;

[WARNING]
The pointer becomes invalid if the underlying JSON object changes&period;

Constant&period;

&lcub;The example below shows how pointers to internal values of a JSON value can be requested&period; Note that no type conversions are made and a `nullptr` is returned if the value and the requested pointer type does not match&period;,get&lowbar;PointerType&rcub;

== Return Value

pointer to the internally stored JSON value if the requested pointer type _PointerType_ fits to the JSON value&semi; `nullptr` otherwise

== Template Parameters

[cols=2]
|===
| Name
| Description
| *PointerType*
| pointer type&semi; must be a pointer to xref:nlohmann/basic_json-0e/array_t.adoc[`array&lowbar;t`], xref:nlohmann/basic_json-0e/object_t.adoc[`object&lowbar;t`], xref:nlohmann/basic_json-0e/string_t.adoc[`string&lowbar;t`], xref:nlohmann/basic_json-0e/boolean_t.adoc[`boolean&lowbar;t`], xref:nlohmann/basic_json-0e/number_integer_t.adoc[`number&lowbar;integer&lowbar;t`], xref:nlohmann/basic_json-0e/number_unsigned_t.adoc[`number&lowbar;unsigned&lowbar;t`], or xref:nlohmann/basic_json-0e/number_float_t.adoc[`number&lowbar;float&lowbar;t`]&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
