pull/1142/head
Niels Lohmann 2018-06-22 22:35:48 +02:00
parent 85f35a1d59
commit 0460b90977
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
1 changed files with 8 additions and 0 deletions

View File

@ -525,6 +525,14 @@ int vi = jn.get<int>();
// etc.
```
Note that `char` types are not automatically converted to JSON strings, but to integer numbers. A conversion to a string must be specified explicitly:
```cpp
char ch = 'A'; // ASCII value 65
json j_default = ch; // stores integer number 65
json j_string = std::string(1, ch); // stores string "A"
```
### Arbitrary types conversions
Every type can be serialized in JSON, not just STL containers and scalar types. Usually, you would do something along those lines: