Skip to content

Commit

Permalink
docs: 文档小优化
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jan 24, 2024
1 parent 9c007b5 commit dbf70c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ void test_jsonization()
// MEO_OPT 表示该变量是一个可选项
// 即使输入中不存在该字段依然可以读取
dumps.erase("i")

// output: { "d" : 0.500000, "map" : { "key" : 5 }, "vec" : [ 1, 2, 3 ] }
std::cout << dumps << std::endl;

MyStruct b;
b.from_json(dumps);
Expand Down
3 changes: 3 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ void test_jsonization()
// MEO_OPT means the var is optional
// and can still be read even if the field doesn't exist in the input.
dumps.erase("i")

// output: { "d" : 0.500000, "map" : { "key" : 5 }, "vec" : [ 1, 2, 3 ] }
std::cout << dumps << std::endl;

MyStruct b;
b.from_json(dumps);
Expand Down

0 comments on commit dbf70c3

Please sign in to comment.