From 3ef8bddb6d27d5164e8954ffc62eac616ed47f9c Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 21 Jun 2019 13:23:15 +0900 Subject: [PATCH] doc: update README --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9748bf4..c67772e 100644 --- a/README.md +++ b/README.md @@ -792,12 +792,7 @@ std::vector vec{1,2,3,4,5}; toml::value v = vec; ``` - - -```cpp -toml::value v = vec; -``` - +All the elements of `initializer_list` should be convertible into `toml::value`. ## Preserving comments @@ -864,10 +859,14 @@ a = [ # this is not a comment for a. this will be ignored. ] # this is a comment for a. ``` -You can also append comments. The interfaces are the same as `std::vector`. +You can also append and modify comments. +The interfaces are the same as `std::vector`. ```cpp -v.comments().push_back(" add new comment."); +toml::basic_value v(42); +v.comments().push_back(" add this comment."); +// # add this comment. +// i = 42 ``` When `toml::discard_comments` is chosen, comments will not be contained in a value.