convert a JSON value to any value type

Synopses

Declared in <nlohmann/adl_serializer.hpp>

convert a JSON value to any value type

template<
    typename BasicJsonType,
    typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
from_json(BasicJsonType&& j) noexcept(/* see-below */);

convert a JSON value to any value type

template<
    typename BasicJsonType,
    typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
from_json(
    BasicJsonType&& j,
    TargetType& val) noexcept(/* see-below */);

Return Value

  • the JSON value converted to TargetType

  • nothing; the result is written to val

Parameters

Name

Description

j

JSON value to read from

val

value to write the converted result to

Created with MrDocs