We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For C++20 users, we support std::ranges somewhat under the DOM API but it is undocumented.
std::ranges
#include "simdjson.h" #include <iostream> #include <ranges> using namespace simdjson; int main(void) { auto cars_json = R"( [ { "make": "Toyota", "model": "Camry", "year": 2018, "tire_pressure": [ 40.1, 39.9, 37.7, 40.4 ] }, { "make": "Kia", "model": "Soul", "year": 2012, "tire_pressure": [ 30.1, 31.0, 28.6, 28.7 ] }, { "make": "Toyota", "model": "Tercel", "year": 1999, "tire_pressure": [ 29.8, 30.0, 30.2, 30.5 ] } ] )"_padded; dom::parser parser; auto justmodel = [](auto car) { return car["model"]; }; for (auto car : parser.parse(cars_json).get_array() | std::views::transform(justmodel)) { std::cout << car << std::endl; } }
Also it would be nice to extend std::ranges to ondemand.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For C++20 users, we support
std::ranges
somewhat under the DOM API but it is undocumented.Also it would be nice to extend
std::ranges
to ondemand.The text was updated successfully, but these errors were encountered: