From 52634ac602fb88644d3a6c9c36ff1ce04d9f0189 Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 23 Jan 2024 17:26:48 +0800 Subject: [PATCH] docs: styles of sample --- README.md | 12 ++++++------ README_en.md | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ebaea36..0554bf8 100644 --- a/README.md +++ b/README.md @@ -123,12 +123,12 @@ void parsing() } std::list to_list = value["list"].as_collection(); - to_list = (std::list)value["list"]; // same as above - to_list = value["list"].as>(); // same as above + to_list = (std::list)value["list"]; // same as above + to_list = value["list"].as>(); // same as above std::set to_set = value["list"].as_collection(); - to_set = (std::set)value["list"]; // same as above - to_set = value["list"].as>(); // same as above + to_set = (std::set)value["list"]; // same as above + to_set = value["list"].as>(); // same as above bool is_map = value["author"].is>(); @@ -137,8 +137,8 @@ void parsing() to_map = value["author"].as>(); // same as above auto to_hashmap = value["author"].as_map(); - to_hashmap = (std::unordered_map)value["author"]; // same as above - to_hashmap = value["author"].as>(); // same as above + to_hashmap = (std::unordered_map)value["author"]; // same as above + to_hashmap = value["author"].as>();// same as above // Output: "literals" using namespace json::literals; diff --git a/README_en.md b/README_en.md index 881e898..9abab83 100644 --- a/README_en.md +++ b/README_en.md @@ -137,8 +137,8 @@ void parsing() to_map = value["author"].as>(); // same as above auto to_hashmap = value["author"].as_map(); - to_hashmap = (std::unordered_map)value["author"]; // same as above - to_hashmap = value["author"].as>(); // same as above + to_hashmap = (std::unordered_map)value["author"]; // same as above + to_hashmap = value["author"].as>();// same as above // Output: "literals" using namespace json::literals;