From 78dd14f36fcc3bc6e6dcdc71ce8efad7f1bbd209 Mon Sep 17 00:00:00 2001 From: Matthieu Garrigues Date: Fri, 9 May 2014 13:49:24 +0000 Subject: [PATCH] Fix multiple definitions of spaces. --- iod_json.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iod_json.hh b/iod_json.hh index 7d2fcc1..10b98d4 100644 --- a/iod_json.hh +++ b/iod_json.hh @@ -124,10 +124,10 @@ namespace iod_internals template inline fill_ fill(T& t) { return fill_(t); } - struct spaces_ {} spaces; struct json_parser { + struct spaces_ {} spaces; inline json_parser(const std::string& _str) : ss(_str), str(_str) {} @@ -259,11 +259,11 @@ namespace iod_internals { T* attr = &o; - p >> spaces >> '"' >> attr->attribute_name() >> '"' >> spaces >> ':'; + p >> p.spaces >> '"' >> attr->attribute_name() >> '"' >> p.spaces >> ':'; iod_from_json(attr->value(), p); if (sizeof...(Tail) != 0) - p >> spaces >> ','; + p >> p.spaces >> ','; iod_attr_from_json(*static_cast*>(&o), p); } @@ -271,7 +271,7 @@ namespace iod_internals template inline void iod_from_json(std::vector& array, json_parser& p) { - p >> '[' >> spaces; + p >> '[' >> p.spaces; if (p.peak() == ']') { p >> ']'; @@ -284,7 +284,7 @@ namespace iod_internals T t; iod_from_json(t, p); array.push_back(t); - p >> spaces; + p >> p.spaces; if (p.peak() == ']') break; else @@ -297,9 +297,9 @@ namespace iod_internals template inline void iod_from_json(iod_object& o, json_parser& p) { - p >> spaces >> '{'; + p >> p.spaces >> '{'; iod_attr_from_json(o, p); - p >> spaces >> '}'; + p >> p.spaces >> '}'; } template