Skip to content

Request: range-based-for over a json-object to expose .first/.second #350

Description

@jaredgrubb

I would love to have the ability to iterate over a JSON object type in exactly the same way I would iterate over a std::map:

for(auto& i : map) { i.first; i.second; }

Would it be possible to have a free function (or member) that would allow me to do something like:
for(auto& i : as_map(jsonObj)) {...}
such that the iterator exposed here works more like map::iterator (.first,.second) than the current iterator type (.key,.value).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind: questionsolution: wontfixthe issue will not be fixed (either it is impossible or deemed out of scope)

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions