Skip to content

Sub-array to vector or map object? #1870

Closed
@flamendless

Description

Hi, how do I store the result of
?? flags = parsed.at("flags");

Into a std::map or std::vector so that I can loop them.

With this .json file:

{
  "width": 640, "height": 480,
  "flags": {
    "Ph": 1, "En": 0, "Fr": 1
  }
}

Specifically i want to for-loop on the ?? return type and have access to the strings (i.e "Ph", "En", etc) and the associated values

I don't want to use auto

Sent from my HUAWEI GR5 2017 using FastHub

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions