[#nlohmann-basic_json-00-get-0a] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-00.adoc[basic_json]::get :relfileprefix: ../../ :mrdocs: get a (pointer) value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>> constexpr decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})) get() const noexcept(noexcept(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4>{}))); ---- == Description Performs explicit type conversion between the JSON value and a compatible value if required. ‐ If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made. ‐ If the requested type is the current xref:nlohmann/basic_json-00/2constructor-0f.adoc[`basic_json`], or a different xref:nlohmann/basic_json-00/2constructor-0f.adoc[`basic_json`] convertible from the current xref:nlohmann/basic_json-00/2constructor-0f.adoc[`basic_json`]. ‐ Otherwise the value is converted by calling the xref:nlohmann/basic_json-00/json_serializer.adoc[`json_serializer<ValueType>`] `from_json()` method. == Exceptions [cols=2] |=== | Name | Thrown on | `what` | xref:nlohmann/basic_json-00/json_serializer.adoc[`json_serializer<ValueType>`] `from_json()` method throws if conversion is required |=== == Return Value copy of the JSON value, converted to == Template Parameters [cols=2] |=== | Name | Description | *ValueTypeCV* | the provided value type | *ValueType* | the returned value type | *ValueType* | if necessary |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#