Skip to content

Commit 78dd14f

Browse files
committed
Fix multiple definitions of spaces.
1 parent 52d8b83 commit 78dd14f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

iod_json.hh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ namespace iod_internals
124124
template <typename T>
125125
inline fill_<T> fill(T& t) { return fill_<T>(t); }
126126

127-
struct spaces_ {} spaces;
128127

129128
struct json_parser
130129
{
130+
struct spaces_ {} spaces;
131131

132132
inline json_parser(const std::string& _str) : ss(_str), str(_str) {}
133133

@@ -259,19 +259,19 @@ namespace iod_internals
259259
{
260260
T* attr = &o;
261261

262-
p >> spaces >> '"' >> attr->attribute_name() >> '"' >> spaces >> ':';
262+
p >> p.spaces >> '"' >> attr->attribute_name() >> '"' >> p.spaces >> ':';
263263

264264
iod_from_json(attr->value(), p);
265265
if (sizeof...(Tail) != 0)
266-
p >> spaces >> ',';
266+
p >> p.spaces >> ',';
267267

268268
iod_attr_from_json(*static_cast<iod_object<Tail...>*>(&o), p);
269269
}
270270

271271
template <typename T>
272272
inline void iod_from_json(std::vector<T>& array, json_parser& p)
273273
{
274-
p >> '[' >> spaces;
274+
p >> '[' >> p.spaces;
275275
if (p.peak() == ']')
276276
{
277277
p >> ']';
@@ -284,7 +284,7 @@ namespace iod_internals
284284
T t;
285285
iod_from_json(t, p);
286286
array.push_back(t);
287-
p >> spaces;
287+
p >> p.spaces;
288288
if (p.peak() == ']')
289289
break;
290290
else
@@ -297,9 +297,9 @@ namespace iod_internals
297297
template <typename ...Tail>
298298
inline void iod_from_json(iod_object<Tail...>& o, json_parser& p)
299299
{
300-
p >> spaces >> '{';
300+
p >> p.spaces >> '{';
301301
iod_attr_from_json(o, p);
302-
p >> spaces >> '}';
302+
p >> p.spaces >> '}';
303303
}
304304

305305
template <typename ...Tail>

0 commit comments

Comments
 (0)