13#include <nlohmann/detail/abi_macros.hpp>
14#include <nlohmann/detail/conversions/from_json.hpp>
15#include <nlohmann/detail/conversions/to_json.hpp>
16#include <nlohmann/detail/meta/identity_tag.hpp>
18NLOHMANN_JSON_NAMESPACE_BEGIN
21template<
typename ValueType,
typename>
26 template<
typename BasicJsonType,
typename TargetType = ValueType>
27 static auto from_json(BasicJsonType && j, TargetType& val)
noexcept(
28 noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
29 ->
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val),
void())
31 ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
36 template<
typename BasicJsonType,
typename TargetType = ValueType>
41 return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {});
46 template<
typename BasicJsonType,
typename TargetType = ValueType>
47 static auto to_json(BasicJsonType& j, TargetType && val)
noexcept(
48 noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))))
49 ->
decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)),
void())
51 ::nlohmann::to_json(j, std::forward<TargetType>(val));
55NLOHMANN_JSON_NAMESPACE_END
namespace for Niels Lohmann
定义 adl_serializer.hpp:23
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
定义 adl_serializer.hpp:37
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
定义 adl_serializer.hpp:47
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
定义 adl_serializer.hpp:27