File: point.h

package info (click to toggle)
simdjson 4.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 31,396 kB
  • sloc: cpp: 195,760; ansic: 20,954; sh: 1,126; python: 885; makefile: 47; ruby: 25; javascript: 13
file content (26 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "diff_results.h"

namespace json_benchmark {

struct point {
  double x;
  double y;
  double z;
};

template<>
struct result_differ<point, point> {
  static bool diff(benchmark::State &state, const point &result, const point &reference, diff_flags flags) {
    return diff_results(state, result.x, reference.x, flags)
        && diff_results(state, result.y, reference.y, flags)
        && diff_results(state, result.z, reference.z, flags);
  }
};

static simdjson_unused std::ostream &operator<<(std::ostream &o, const point &p) {
  return o << p.x << "," << p.y << "," << p.z << std::endl;
}

} // namespace json_benchmark