@@ -2607,19 +2607,31 @@ using is_detected_convertible =
2607
2607
@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_IMPL
2608
2608
@since version 3.9.2
2609
2609
*/
2610
- #define NLOHMANN_DEFINE_TYPE_INTRUSIVE_IMPL(BasicJsonType, Type, ...) \
2611
- friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2612
- friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
2610
+ #define NLOHMANN_DEFINE_TYPE_INTRUSIVE_IMPL(BasicJsonType, Type, ...) \
2611
+ friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) \
2612
+ { \
2613
+ NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) \
2614
+ } \
2615
+ friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) \
2616
+ { \
2617
+ NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) \
2618
+ }
2613
2619
2614
2620
/*!
2615
2621
@brief macro to briefly define non-intrusive serialization of a given type to/from JSON
2616
2622
@note you can define your own specialized macroses like NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE
2617
2623
@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_IMPL
2618
2624
@since version 3.9.2
2619
2625
*/
2620
- #define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_IMPL(BasicJsonType, Type, ...) \
2621
- inline void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \
2622
- inline void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) }
2626
+ #define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_IMPL(BasicJsonType, Type, ...) \
2627
+ inline void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) \
2628
+ { \
2629
+ NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) \
2630
+ } \
2631
+ inline void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) \
2632
+ { \
2633
+ NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) \
2634
+ }
2623
2635
2624
2636
/*!
2625
2637
@brief macro to briefly define intrusive serialization of given type to/from nlohmann::json
@@ -2699,7 +2711,7 @@ using is_detected_convertible =
2699
2711
friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) \
2700
2712
{ \
2701
2713
NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) \
2702
- } \
2714
+ }
2703
2715
2704
2716
/*!
2705
2717
@brief macro to briefly define non-intrusive serialization of a given type to/from any basic_json object
0 commit comments