File indexing completed on 2024-11-15 09:44:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <utility>
0012
0013 #include <nlohmann/detail/abi_macros.hpp>
0014 #include <nlohmann/detail/conversions/from_json.hpp>
0015 #include <nlohmann/detail/conversions/to_json.hpp>
0016 #include <nlohmann/detail/meta/identity_tag.hpp>
0017
0018 NLOHMANN_JSON_NAMESPACE_BEGIN
0019
0020
0021 template<typename ValueType, typename>
0022 struct adl_serializer
0023 {
0024
0025
0026 template<typename BasicJsonType, typename TargetType = ValueType>
0027 static auto from_json(BasicJsonType && j, TargetType& val) noexcept(
0028 noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)))
0029 -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
0030 {
0031 ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
0032 }
0033
0034
0035
0036 template<typename BasicJsonType, typename TargetType = ValueType>
0037 static auto from_json(BasicJsonType && j) noexcept(
0038 noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})))
0039 -> decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
0040 {
0041 return ::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {});
0042 }
0043
0044
0045
0046 template<typename BasicJsonType, typename TargetType = ValueType>
0047 static auto to_json(BasicJsonType& j, TargetType && val) noexcept(
0048 noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))))
0049 -> decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void())
0050 {
0051 ::nlohmann::to_json(j, std::forward<TargetType>(val));
0052 }
0053 };
0054
0055 NLOHMANN_JSON_NAMESPACE_END