c++ - Looping over an array in RapidJson and getting the object elements -
how value out of constrvalueiterator? in case know elements of array dictionaries (aka objects).
code summed up:
for (rapidjson::value::constvalueiterator itr = rawbuttons.begin(); itr != rawbuttons.end(); ++itr) { // ok if (itr->hasmember("yes")) { // ok auto somestring = itr["yes"]->getstring(); // error } }
um. iterators need dereferenced or whatever it's called.
for (rapidjson::value::constvalueiterator itr = rawbuttons.begin(); itr != rawbuttons.end(); ++itr) { // ok if (itr->hasmember("yes")) { // ok auto somestring = (*itr)["yes"]->getstring(); // bingo } }
Comments
Post a Comment