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

Function sample3

sample/Extra-Conditionals-with-Match-Guards.cpp:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void sample3()
53{
54 auto const x = 4;
55 auto const y = false;
56
57 std::cout << match(x)(
58 // clang-format off
59 pattern | or_(4, 5, 6) | when(expr(y)) = expr("yes"),
60 pattern | _ = expr("no")
61 // clang-format on
62 )
63 << std::endl;
64}
65
66int32_t main()
67{

Callers 1

mainFunction · 0.70

Calls 4

or_Function · 0.85
whenFunction · 0.85
matchFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected