c++ json-nlohmann accessing the list elements
<p>I'm trying to use <a href="https://github.com/nlohmann/json" rel="nofollow">json-nlohmann</a> library to read JSON files in C++ </p>

<p>So far I got along with it preatty well, but now I'm trying to access elements of the list in given json. JSON: </p>

<pre><code>{
    "GameMap": "path_to_game_map",
    "Objects": [
        { "object_1": { "Transform": { "Position": { "X": 1, "Y": 2 }, "Rotation": { "X": 3.5, "Y": 8.2 }, "Scale": { "X": 1, "Y":1 } },
                        "Components": [
                        { "0": { "data": { "some_data": "false" } } },
                        { "1": { "data": { "some_data": "false" } } },
                        { "2": { "data": { "some_data": "false" } } }
                        ] } },
        { "object_2": { "Transform": { "Position": { "X": 1, "Y": 2 }, "Rotation": { "X": 3.5, "Y": 8.2}, "Scale": { "X": 1, "Y":1 } },
                        "Components": [
                        { "0": { "data": { "some_data": "false" } } },
                        { "1": { "data": { "some_data": "false" } } },
                        { "2": { "data": { "some_data": "false" } } }
                        ] } }                   
    ]
}
</code></pre>

<p>Where I'm trying to access each Component and read it's key value. </p>

<p>I've got an object out for every Component. But I just cannot figure out how to read its key and value.</p>

<p>Help! Please.</p>