@@ -85,10 +85,9 @@ namespace detail
85
85
} // namespace detail
86
86
} // namespace simple_enum::inline v0_8
87
87
88
- namespace glz
89
- {
88
+
90
89
template <simple_enum::bounded_enum enumeration_type>
91
- struct meta <enumeration_type>
90
+ struct glz :: meta<enumeration_type>
92
91
{
93
92
static constexpr bool custom_write = true ;
94
93
static constexpr bool custom_read = true ;
@@ -97,14 +96,15 @@ struct meta<enumeration_type>
97
96
static constexpr auto value = simple_enum::detail::make_glaze_tuple<enumeration_type>();
98
97
};
99
98
100
- } // namespace glz
101
-
102
- namespace glz ::detail
103
- {
99
+ #ifdef glaze_v5_0_0
100
+ namespace glz_to_from_ns = glz;
101
+ #else
102
+ namespace glz_to_from_ns = glz::detail;
103
+ #endif
104
104
105
105
template <simple_enum::bounded_enum enumeration_type>
106
106
#ifdef glaze_v3_5_0_to_from
107
- struct from <glz::JSON, enumeration_type>
107
+ struct glz_to_from_ns :: from<glz::JSON, enumeration_type>
108
108
#else
109
109
struct from_json <enumeration_type>
110
110
#endif
@@ -115,7 +115,11 @@ struct from_json<enumeration_type>
115
115
{
116
116
std::string_view value;
117
117
#ifdef glaze_v3_5_0_to_from
118
+ #ifdef glaze_v5_0_0_generic_supported
119
+ parse<glz::JSON>::op<Opts>(value, ctx, args...);
120
+ #else
118
121
read<glz::JSON>::op<Opts>(value, ctx, args...);
122
+ #endif
119
123
#else
120
124
read<glz::json>::op<Opts>(value, ctx, args...);
121
125
#endif
@@ -136,7 +140,7 @@ struct from_json<enumeration_type>
136
140
137
141
template <simple_enum::bounded_enum enumeration_type>
138
142
#ifdef glaze_v3_5_0_to_from
139
- struct to <glz::JSON, enumeration_type>
143
+ struct glz_to_from_ns :: to<glz::JSON, enumeration_type>
140
144
#else
141
145
struct to_json <enumeration_type>
142
146
#endif
@@ -147,11 +151,14 @@ struct to_json<enumeration_type>
147
151
{
148
152
std::string_view value{simple_enum::enum_name (arg)};
149
153
#ifdef glaze_v3_5_0_to_from
154
+ #ifdef glaze_v5_0_0_generic_supported
155
+ serialize<glz::JSON>::op<Opts>(value, args...);
156
+ #else
150
157
write<glz::JSON>::op<Opts>(value, args...);
158
+ #endif
151
159
#else
152
160
write<glz::json>::op<Opts>(value, args...);
153
161
#endif
154
162
}
155
163
};
156
- } // namespace glz::detail
157
164
0 commit comments