Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{"array": [1, 2, 3]"bool": true"double": 42.1"int": 42"map": {"key": "value"}"null": null"string": "hello"}]
- #include <cassert>
- #include <chrono>
- #include <sstream>
- #include <string_view>
- #include "json.h"
- using namespace json;
- using namespace std::literals;
- // namespace
- void MinifiedLoad() {
- std::string s = "[{\"array\":[1,2,3],\"bool\":true,\"double\":42.1,\"int\":42,\"map\":{\"key\":\"value\"},\"null\":null,\"string\":\"hello\"}]";
- Array arr;
- arr.emplace_back(Dict{
- {"int"s, 42},
- {"double"s, 42.1},
- {"null"s, nullptr},
- {"string"s, "hello"s},
- {"array"s, Array{1, 2, 3}},
- {"bool"s, true},
- {"map"s, Dict{{"key"s, "value"s}}},
- });
- std::stringstream strm;
- strm << s;
- const auto doc = Load(strm);
- Print(doc, std::cout);
- }
- int main() {
- MinifiedLoad();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement