doc: explain about the type of the top-level value

fix #120.
This commit is contained in:
ToruNiina
2020-06-21 14:00:03 +09:00
parent c22a3fd227
commit 2164fd39f7

View File

@@ -119,6 +119,9 @@ const std::string fname("sample.toml");
const toml::value data = toml::parse(fname);
```
As required by the TOML specification, the top-level value is always a table.
You can find a value inside it, cast it into a table explicitly, and insert it as a value into other `toml::value`.
If it encounters an error while opening a file, it will throw `std::runtime_error`.
You can also pass a `std::istream` to the `toml::parse` function.