MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / eval

Function eval

test/matchit/constexpr.cpp:23–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22template <typename Value>
23constexpr auto eval(Value &&input)
24{
25 return match(input)(
26 // clang-format off
27 pattern | ds('/', 1, 1) = expr(1),
28 pattern | ds('/', 0, _) = expr(0),
29 pattern | _ = expr(-1));
30 // clang-format on
31}
32
33static_assert(eval(std::make_tuple('/', 0, 5)) == 0);

Callers 1

constexpr.cppFile · 0.70

Calls 3

matchFunction · 0.50
dsFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected