Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Problem web::json::value cbegin()

$
0
0
As of 2.0 the value do not return a iterator.
See https://casablanca.codeplex.com/releases/view/119893

but you are basically missing a "as_object()" and the iter->first return a string_t and not an value.

So if you follow all the examples on the internet you will have to do something like
for (auto iter = v.as_object().cbegin(); iter != v.as_object().cend(); ++iter) {
const string_t& foo = iter->first;
const json::value& bar = iter->second;
//continue......
}
if you are sure the json value is an object

If it is an array you do
for (auto iter = v.as_array().cbegin(); iter != v.as_array.cend(); ++iter) {
}

but use the "testers" to be sure that it is an object or array.

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>