Avoiding the unused errors.

This commit is contained in:
Daniel Lemire 2020-06-17 14:19:58 +00:00
parent 0d4e501239
commit 6537d0dc76
1 changed files with 16 additions and 3 deletions

View File

@ -209,7 +209,11 @@ namespace document_tests {
simdjson::dom::parser parser1;
for (simdjson::padded_string str : json_strings) {
auto [element, error] = parser1.parse(str);
std::cout << element << std::endl;
if(error) {
std::cerr << error << std::endl;
} else {
std::cout << element << std::endl;
}
}
std::vector<std::string> file_paths{
ADVERSARIAL_JSON, FLATADVERSARIAL_JSON, DEMO_JSON,
@ -218,13 +222,22 @@ namespace document_tests {
for (auto path : file_paths) {
simdjson::dom::parser parser2;
std::cout << "file: " << path << std::endl;
UNUSED auto [element, error] = parser2.load(path);
auto [element, error] = parser2.load(path);
if(error) {
std::cerr << error << std::endl;
} else {
std::cout << element.type() << std::endl;
}
}
simdjson::dom::parser parser3;
for (auto path : file_paths) {
std::cout << "file: " << path << std::endl;
auto [element, error] = parser3.load(path);
std::cout << "\t- error? " << error << std::endl;
if(error) {
std::cerr << error << std::endl;
} else {
std::cout << element.type() << std::endl;
}
}
return true;
}