| 14 | #include <nlohmann/json.hpp> |
| 15 | |
| 16 | static std::string read_file(const char* path) { |
| 17 | std::ifstream f(path, std::ios::binary); |
| 18 | if (!f) { |
| 19 | std::fprintf(stderr, "cannot open %s\n", path); |
| 20 | std::exit(1); |
| 21 | } |
| 22 | std::ostringstream ss; |
| 23 | ss << f.rdbuf(); |
| 24 | return ss.str(); |
| 25 | } |
| 26 | |
| 27 | template <typename F> |
| 28 | static void run(const char* name, int iters, F&& fn) { |