Merge pull request #119 from halfelf/fix/readme_finding_value_in_table

fix: "Finding a value in an array" example in README
This commit is contained in:
Toru Niina
2020-05-20 00:27:33 +09:00
committed by GitHub

View File

@@ -266,11 +266,11 @@ shape = "round"
``` cpp
const auto data = toml::parse("fruit.toml");
const auto& fruit = toml::find(data, "fruit");
const auto name = toml::find<std::string>(fruit, "apple");
const auto name = toml::find<std::string>(fruit, "name");
const auto& physical = toml::find(fruit, "physical");
const auto color = toml::find<std::string>(fruit, "color");
const auto shape = toml::find<std::string>(fruit, "shape");
const auto color = toml::find<std::string>(physical, "color");
const auto shape = toml::find<std::string>(physical, "shape");
```
Here, variable `fruit` is a `toml::value` and can be used as the first argument