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

Function sample3

sample/Identifier-pattern.cpp:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 match(value)(pattern | name_age(person_name, 18 <= _ && _ <= 150) = [] {});
31}
32void sample3()
33{
34 constexpr auto x = std::make_optional(3);
35 Id<int32_t> y;
36 match(x)(
37 // No need to worry about y's type, by ref or by value is automatically
38 // managed by `match(it)` library.
39 pattern | some(y) = [] {});
40}
41
42void sample4()
43{

Callers 1

mainFunction · 0.70

Calls 1

matchFunction · 0.50

Tested by

no test coverage detected