default JSONSerializer template argument
More...
|
template<typename BasicJsonType , typename TargetType = ValueType> |
static auto | from_json (BasicJsonType &&j, TargetType &val) noexcept(noexcept(::nlohmann::from_json(std::forward< BasicJsonType >(j), val))) -> decltype(::nlohmann::from_json(std::forward< BasicJsonType >(j), val), void()) |
| convert a JSON value to any value type
|
|
template<typename BasicJsonType , typename TargetType = ValueType> |
static auto | from_json (BasicJsonType &&j) noexcept(noexcept(::nlohmann::from_json(std::forward< BasicJsonType >(j), detail::identity_tag< TargetType > {}))) -> decltype(::nlohmann::from_json(std::forward< BasicJsonType >(j), detail::identity_tag< TargetType > {})) |
| convert a JSON value to any value type
|
|
template<typename BasicJsonType , typename TargetType = ValueType> |
static auto | to_json (BasicJsonType &j, TargetType &&val) noexcept(noexcept(::nlohmann::to_json(j, std::forward< TargetType >(val)))) -> decltype(::nlohmann::to_json(j, std::forward< TargetType >(val)), void()) |
| convert any value type to a JSON value
|
|
template<typename ValueType, typename>
struct nlohmann::adl_serializer< ValueType, typename >
default JSONSerializer template argument
This serializer ignores the template arguments and uses ADL (argument-dependent lookup) for serialization.
◆ from_json() [1/2]
template<typename ValueType , typename >
template<typename BasicJsonType , typename TargetType = ValueType>
convert a JSON value to any value type
This function is usually called by the get()
function of the basic_json class (either explicit or via conversion operators).
- Note
- This function is chosen for value types which are not default-constructible.
- Parameters
-
[in] | j | JSON value to read from |
- Returns
- copy of the JSON value, converted to ValueType
◆ from_json() [2/2]
template<typename ValueType , typename >
template<typename BasicJsonType , typename TargetType = ValueType>
static auto nlohmann::adl_serializer< ValueType, typename >::from_json |
( |
BasicJsonType && |
j, |
|
|
TargetType & |
val |
|
) |
| -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
|
|
inlinestaticnoexcept |
convert a JSON value to any value type
This function is usually called by the get()
function of the basic_json class (either explicit or via conversion operators).
- Note
- This function is chosen for default-constructible value types.
- Parameters
-
[in] | j | JSON value to read from |
[in,out] | val | value to write to |
◆ to_json()
template<typename ValueType , typename >
template<typename BasicJsonType , typename TargetType = ValueType>
static auto nlohmann::adl_serializer< ValueType, typename >::to_json |
( |
BasicJsonType & |
j, |
|
|
TargetType && |
val |
|
) |
| -> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void())
|
|
inlinestaticnoexcept |
convert any value type to a JSON value
This function is usually called by the constructors of the basic_json class.
- Parameters
-
[in,out] | j | JSON value to write to |
[in] | val | value to read from |
The documentation for this struct was generated from the following file: