Two new macroses NLOHMANN_DEFINE_TYPE_INTRUSIVE_2 and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_2 are renamed to *_T. Also doxygen docs for them are improved

This commit is contained in:
Krylov Yaroslav 2020-12-14 13:57:34 +03:00
parent 985d3ea852
commit 8d7c38efb1
No known key found for this signature in database
GPG Key ID: 4C127DE932933076
2 changed files with 12 additions and 12 deletions

View File

@ -293,20 +293,20 @@
inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
/*!
@brief macro
@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_2
@brief macro to briefly define intrusive serialization of a given type to/from any basic_json object
@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_T
@since version 3.9.2
*/
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_2(Type, ...) \
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_T(Type, ...) \
template<typename BasicJsonType> friend void to_json(JsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
template<typename BasicJsonType> friend void from_json(const JsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
/*!
@brief macro
@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_2
@brief macro to briefly define non-intrusive serialization of a given type to/from any basic_json object
@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_T
@since version 3.9.2
*/
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_2(Type, ...) \
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_T(Type, ...) \
template<typename BasicJsonType> void to_json(JsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
template<typename BasicJsonType> void from_json(const JsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }

View File

@ -2370,20 +2370,20 @@ JSON_HEDLEY_DIAGNOSTIC_POP
inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
/*!
@brief macro
@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_2
@brief macro to briefly define intrusive serialization of a given type to/from any basic_json object
@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_T
@since version 3.9.2
*/
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_2(Type, ...) \
#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_T(Type, ...) \
template<typename BasicJsonType> friend void to_json(JsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
template<typename BasicJsonType> friend void from_json(const JsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
/*!
@brief macro
@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_2
@brief macro to briefly define non-intrusive serialization of a given type to/from any basic_json object
@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_T
@since version 3.9.2
*/
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_2(Type, ...) \
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_T(Type, ...) \
template<typename BasicJsonType> void to_json(JsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
template<typename BasicJsonType> void from_json(const JsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }