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

Function sample1

sample/Wildcard-pattern.cpp:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace matchit;
5
6void sample1()
7{
8 constexpr auto x = 20;
9 Id<int32_t> a;
10 match(10, x)(
11 // the x is always matched by _
12 pattern | ds(a, _) = [&]
13 { assert(*a == 10); });
14}
15
16void sample2()
17{

Callers 1

mainFunction · 0.70

Calls 2

matchFunction · 0.50
dsFunction · 0.50

Tested by

no test coverage detected