You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible or planned to be able to use a range-based for loop to iterate over a non-array object?
That is, you can do:
for (auto& element : j)
std::cout << element << std::endl;
for an array [ "a", "b" ] but not for {"foo": "bar", "quux":"baaz"} (well, range-based iteration works if you don't care about the key)
The json package compiles and works just fine under C++17, so I would like to be able to do:
for (auto& [key, value] : j)
std::cout << key << " : " << value << std::endl;
I am sure there are more important feature requests (e.g. SAX read & write) but I thought I would submit this one anyway. This package is great! Thanks, d
The text was updated successfully, but these errors were encountered:
It is possible or planned to be able to use a range-based for loop to iterate over a non-array object?
That is, you can do:
for an array
[ "a", "b" ]
but not for{"foo": "bar", "quux":"baaz"}
(well, range-based iteration works if you don't care about the key)The json package compiles and works just fine under C++17, so I would like to be able to do:
I am sure there are more important feature requests (e.g. SAX read & write) but I thought I would submit this one anyway. This package is great! Thanks, d
The text was updated successfully, but these errors were encountered: