diff --git a/README.md b/README.md index 70847ef..8c192ea 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,16 @@ toml11 is a feature-rich TOML language library for C++11/14/17/20. ## Example +```toml +# example.toml +title = "an example toml file" +nums = [3, 1, 4, 1, 5] # pi! +``` + ```cpp #include #include -// ```toml -// title = "an example toml file" -// nums = [3, 1, 4, 1, 5] # pi! -// ``` - int main() { // select TOML version at runtime (optional) @@ -50,7 +51,7 @@ int main() } if(data.at("nums").is_array()) { - data.push_back(9); + data["nums"].as_array().push_back(9); } // check comments