Files
simdjson-simdjson/examples/quickstart/quickstart_noexceptions.cpp
T
Daniel Lemire 6d7c77ddc1 Let us try to check with the exceptions disabled. (#707)
* Tweaking code so that we can run all tests with exceptions off.
* Removing SIMDJSON_DISABLE_EXCEPTIONS
2020-04-15 16:45:36 -04:00

19 lines
488 B
C++

#include "simdjson.h"
int main(void) {
simdjson::dom::parser parser;
simdjson::dom::element tweets;
simdjson::error_code error;
parser.load("twitter.json").tie(tweets,error);
if (error) { std::cerr << error << std::endl; return EXIT_FAILURE; }
simdjson::dom::element res;
tweets["search_metadata"]["count"].tie(res,error);
if(error) {
std::cerr << "could not access keys" << std::endl;
return EXIT_FAILURE;
}
std::cout << res << " results." << std::endl;
}