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

Function sample2

sample/Identifier-pattern.cpp:26–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24auto const name_age = dsVia(&Person::name, &Person::age);
25
26void sample2()
27{
28 auto const value = Person{"John", 23};
29 Id<std::string> person_name;
30 match(value)(pattern | name_age(person_name, 18 <= _ && _ <= 150) = [] {});
31}
32void sample3()
33{
34 constexpr auto x = std::make_optional(3);

Callers 1

mainFunction · 0.70

Calls 1

matchFunction · 0.50

Tested by

no test coverage detected