lundi 31 octobre 2016

C11 for json syntax

I try nlohmann json, it's c11 syntax is really impressive. I want to know how does this works?, and how to implement. please check the below two great features.

using json = nlohmann::json;
json j1 = {
            "pi": 3.141,
            "happy": true,
            "name": "Niels",
            "nothing": null,
            "answer": {
            "everything": 42
             },
            "list": [1, 0, 2],
            "object": {
            "currency": "USD",
            "value": 42.99
           }
         };

     json j = "{ \"happy\": true, \"pi\": 3.141 }"_json;

Aucun commentaire:

Enregistrer un commentaire