Skip to content

Commit

Permalink
fix: typos of sample
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jan 23, 2024
1 parent 279edb9 commit 968778e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ void parsing()

std::list<int> to_list = value["list"].as_collection<int, std::list>();
to_list = (std::list<int>)value["list"]; // same as above
to_list = value.as<std::list<int>>(); // same as above
to_list = value["list"].as<std::list<int>>(); // same as above

std::set<int> to_set = value["list"].as_collection<int, std::set>();
to_set = (std::set<int>)value["list"]; // same as above
to_set = value.as<std::set<int>>(); // same as above
to_set = value["list"].as<std::set<int>>(); // same as above

bool is_map = value["author"].is<std::map<std::string, std::string>>();

std::map<std::string, std::string> to_map = value["author"].as_map<std::string>();
to_map = (std::map<std::string, std::string>)value["author"]; // same as above
to_map = value["author"].as<std::map<std::string, std::string>>(); // same as above
Expand Down
8 changes: 4 additions & 4 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ void parsing()
}

std::list<int> to_list = value["list"].as_collection<int, std::list>();
to_list = (std::list<int>)value["list"]; // same as above
to_list = value.as<std::list<int>>(); // same as above
to_list = (std::list<int>)value["list"]; // same as above
to_list = value["list"].as<std::list<int>>(); // same as above

std::set<int> to_set = value["list"].as_collection<int, std::set>();
to_set = (std::set<int>)value["list"]; // same as above
to_set = value.as<std::set<int>>(); // same as above
to_set = (std::set<int>)value["list"]; // same as above
to_set = value["list"].as<std::set<int>>(); // same as above

bool is_map = value["author"].is<std::map<std::string, std::string>>();

Expand Down
4 changes: 2 additions & 2 deletions sample/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ bool parsing()

std::list<int> to_list = value["list"].as_collection<int, std::list>();
to_list = (std::list<int>)value["list"];
to_list = value.as<std::list<int>>();
to_list = value["list"].as<std::list<int>>();

std::set<int> to_set = value["list"].as_collection<int, std::set>();
to_set = (std::set<int>)value["list"];
to_set = value.as<std::set<int>>();
to_set = value["list"].as<std::set<int>>();

bool is_map = value["author"].is<std::map<std::string, std::string>>();
if (is_map) {
Expand Down

0 comments on commit 968778e

Please sign in to comment.