MCPcopy Create free account
hub / github.com/BowenFu/hspp / operator()

Method operator()

sample/parse_expr.cpp:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 {}
45 template <typename T>
46 constexpr auto operator()(T x, T y) const
47 {
48 switch (mOp)
49 {
50 case Op::kADD: return x + y;
51 case Op::kSUB: return x - y;
52 case Op::kMUL: return x * y;
53 case Op::kDIV: return x / y;
54 }
55 throw std::runtime_error{"Never reach here!"};
56 }
57};
58
59namespace op

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected