[#nlohmann-basic_json-0c-value-0b] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic_json]::value :relfileprefix: ../../ :mrdocs: access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class ReturnType = value_return_type<ValueType>::type> requires !detail::is_transparent<object_comparator_t>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( object_t::key_type const& key, ValueType&& default_value) const; ---- == Return Value value at _key_ if found, otherwise _default_value_ == Parameters [cols="1,4"] |=== | Name| Description | *key* | key of the element to access | *default_value* | value to return if _key_ is not found |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#