Template Struct adl_serializer

Struct Documentation

template<typename, typename>
struct adl_serializer

default JSONSerializer template argument

This serializer ignores the template arguments and uses ADL (argument-dependent lookup) for serialization.

Public Static Functions

template<typename BasicJsonType, typename ValueType>
static inline auto from_json(BasicJsonType &&j, ValueType &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

This function is usually called by the get() function of the basic_json class (either explicit or via conversion operators).

Parameters:
  • j[in] JSON value to read from

  • val[inout] value to write to

template<typename BasicJsonType, typename ValueType>
static inline auto to_json(BasicJsonType &j, ValueType &&val) noexcept(noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val)))) -> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void())

convert any value type to a JSON value

This function is usually called by the constructors of the basic_json class.

Parameters:
  • j[inout] JSON value to write to

  • val[in] value to read from

template<typename BasicJsonType, typename ValueType>
static inline auto from_json(BasicJsonType &&j, ValueType &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

This function is usually called by the get() function of the basic_json class (either explicit or via conversion operators).

Parameters:
  • j[in] JSON value to read from

  • val[inout] value to write to

template<typename BasicJsonType, typename ValueType>
static inline auto to_json(BasicJsonType &j, ValueType &&val) noexcept(noexcept(::nlohmann::to_json(j, std::forward<ValueType>(val)))) -> decltype(::nlohmann::to_json(j, std::forward<ValueType>(val)), void())

convert any value type to a JSON value

This function is usually called by the constructors of the basic_json class.

Parameters:
  • j[inout] JSON value to write to

  • val[in] value to read from