Skip to content

Commit

Permalink
cmake format
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Nov 2, 2023
1 parent 9b53bbb commit 09800a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/simdjson/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "simdjson.h"
#include <iostream>

#include "simdjson.h"
using namespace simdjson;

int main() {
Expand All @@ -13,7 +14,8 @@ int main() {
// Iterating through an array of objects
for (ondemand::object car : parser.iterate(cars_json)) {
// Accessing a field by name
std::cout << "Make/Model: " << std::string_view(car["make"]) << "/" << std::string_view(car["model"]) << std::endl;
std::cout << "Make/Model: " << std::string_view(car["make"]) << "/"
<< std::string_view(car["model"]) << std::endl;

// Casting a JSON element to an integer
uint64_t year = car["year"];
Expand All @@ -26,5 +28,4 @@ int main() {
}
std::cout << "- Average tire pressure: " << (total_tire_pressure / 4) << std::endl;
}

}

0 comments on commit 09800a2

Please sign in to comment.