|
JSON for Modern C++
3.0
|
|
inline |
Create an empty JSON value with a given type. The value will be default initialized with an empty value which depends on the type:
| Value type | initial value |
|---|---|
| null | null |
| boolean | false |
| string | "" |
| number | 0 |
| object | {} |
| array | [] |
| [in] | value | the type of the value to create |
| std::bad_alloc | if allocation for object, array, or string value fails (thrown by the constructors of json_value) |
null
false
0
0
{}
[]
""
The example code above can be translated withg++ -std=c++11 -Isrc doc/examples/basic_json__value_t.cpp -o basic_json__value_t.