Skip to content

Commit

Permalink
Fix multiple definitions of spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-42 committed May 9, 2014
1 parent 52d8b83 commit 78dd14f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions iod_json.hh
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ namespace iod_internals
template <typename T>
inline fill_<T> fill(T& t) { return fill_<T>(t); }

struct spaces_ {} spaces;

struct json_parser
{
struct spaces_ {} spaces;

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

Expand Down Expand Up @@ -259,19 +259,19 @@ 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<iod_object<Tail...>*>(&o), p);
}

template <typename T>
inline void iod_from_json(std::vector<T>& array, json_parser& p)
{
p >> '[' >> spaces;
p >> '[' >> p.spaces;
if (p.peak() == ']')
{
p >> ']';
Expand All @@ -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
Expand All @@ -297,9 +297,9 @@ namespace iod_internals
template <typename ...Tail>
inline void iod_from_json(iod_object<Tail...>& o, json_parser& p)
{
p >> spaces >> '{';
p >> p.spaces >> '{';
iod_attr_from_json(o, p);
p >> spaces >> '}';
p >> p.spaces >> '}';
}

template <typename ...Tail>
Expand Down

0 comments on commit 78dd14f

Please sign in to comment.