mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
add missing example toml data to README
This commit is contained in:
@@ -48,6 +48,13 @@ If there are syntax error in the toml file,
|
|||||||
|
|
||||||
Then you can obtain the various value from the `data` using `toml::get` function.
|
Then you can obtain the various value from the `data` using `toml::get` function.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
answer = 42
|
||||||
|
pi = 3.14
|
||||||
|
numbers = [1,2,3]
|
||||||
|
time = 1979-05-27T07:32:00Z
|
||||||
|
```
|
||||||
|
|
||||||
``` cpp
|
``` cpp
|
||||||
const auto answer = toml::get<std::int64_t>(data.at("answer"));
|
const auto answer = toml::get<std::int64_t>(data.at("answer"));
|
||||||
const auto pi = toml::get<double>(data.at("pi"));
|
const auto pi = toml::get<double>(data.at("pi"));
|
||||||
|
Reference in New Issue
Block a user