JSON for Modern C++  3.7.0

◆ get() [4/6]

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>
template<typename ValueTypeCV , typename ValueType = detail::uncvref_t<ValueTypeCV>, detail::enable_if_t< not std::is_same< basic_json_t, ValueType >::value and detail::has_non_default_from_json< basic_json_t, ValueType >::value, int > = 0>
ValueType nlohmann::basic_json::get ( ) const

Explicit type conversion between the JSON value and a compatible value which is not CopyConstructible and not DefaultConstructible. The value is converted by calling the json_serializer<ValueType> from_json() method.

The function is equivalent to executing

return JSONSerializer<ValueTypeCV>::from_json(*this);

This overloads is chosen if:

If json_serializer<ValueType> has both overloads of from_json(), this one is chosen.
Template Parameters
ValueTypeCVthe provided value type
ValueTypethe returned value type
copy of the JSON value, converted to ValueType
whatjson_serializer<ValueType> from_json() method throws
version 2.1.0

Definition at line 17041 of file json.hpp.