|
JSON for Modern C++
3.0
|
|
inlinestatic |
Creates a JSON object value from a given initializer list. The initializer lists elements must be pairs, and their first elments must be strings. If the initializer list is empty, the empty object {} is created.
| [in] | init | initializer list to create an object from (optional) |
| std::domain_error | if init is not a pair whose first elements are strings; thrown by basic_json(list_init_t, bool, value_t) |
{}
{}
{"one":1,"two":2}
The example code above can be translated withg++ -std=c++11 -Isrc doc/examples/object.cpp -o object.