mirror of
https://github.com/nlohmann/json.git
synced 2025-08-09 05:22:48 +03:00
added inline to DEFINE_TYPE macro
This commit is contained in:
@@ -282,8 +282,8 @@
|
|||||||
@since version 3.9.0
|
@since version 3.9.0
|
||||||
*/
|
*/
|
||||||
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
|
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
|
||||||
void to_json(nlohmann::json& j, const Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
|
inline void to_json(nlohmann::json& j, const Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
|
||||||
void from_json(const nlohmann::json& j, Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
|
inline void from_json(const nlohmann::json& j, Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
|
||||||
|
|
||||||
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
|
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
|
||||||
#define JSON_USE_IMPLICIT_CONVERSIONS 1
|
#define JSON_USE_IMPLICIT_CONVERSIONS 1
|
||||||
|
@@ -2299,8 +2299,8 @@ JSON_HEDLEY_DIAGNOSTIC_POP
|
|||||||
@since version 3.9.0
|
@since version 3.9.0
|
||||||
*/
|
*/
|
||||||
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
|
#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \
|
||||||
void to_json(nlohmann::json& j, const Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
|
inline void to_json(nlohmann::json& j, const Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
|
||||||
void from_json(const nlohmann::json& j, Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
|
inline void from_json(const nlohmann::json& j, Type& t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
|
||||||
|
|
||||||
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
|
#ifndef JSON_USE_IMPLICIT_CONVERSIONS
|
||||||
#define JSON_USE_IMPLICIT_CONVERSIONS 1
|
#define JSON_USE_IMPLICIT_CONVERSIONS 1
|
||||||
@@ -25043,7 +25043,7 @@ template<>
|
|||||||
inline void swap<nlohmann::json>(nlohmann::json& j1, nlohmann::json& j2) noexcept(
|
inline void swap<nlohmann::json>(nlohmann::json& j1, nlohmann::json& j2) noexcept(
|
||||||
is_nothrow_move_constructible<nlohmann::json>::value&&
|
is_nothrow_move_constructible<nlohmann::json>::value&&
|
||||||
is_nothrow_move_assignable<nlohmann::json>::value
|
is_nothrow_move_assignable<nlohmann::json>::value
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
j1.swap(j2);
|
j1.swap(j2);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user