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

Function sample1

sample/Extractor-Pattern.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18inline constexpr Is<T> is;
19
20auto sample1()
21{
22 const auto x = std::make_tuple(std::string("str"), 123);
23 using namespace matchit;
24 Id<std::string> s;
25 Id<int> i;
26 match(x)(pattern | ds(app(is<std::string>, s), app(is<int>, i)) = [&]
27 { std::cout << "first " << *s << " second " << *i; });
28 std::cout << std::endl;
29}
30
31struct Email
32{

Callers 1

mainFunction · 0.70

Calls 3

appFunction · 0.85
matchFunction · 0.50
dsFunction · 0.50

Tested by

no test coverage detected