Skip to content

How to construct an iteratable usage in nlohmann json? #636

Description

@intijk

Recently I am thinking to have some thing like this,

Foo a, b, c;
json j=json(Array());
j.push_back(&a);
j.push_back(&b);
j.push_back(&c);

for(auto e: j){
//e would get a pointer to Foo class.
}

Is this possible to implement? I tried to_json and from_json , but seems the features are limited.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions