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

Function getSecond

sample/customDs.cpp:35–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33} // namespace std
34
35constexpr auto getSecond(DummyStruct const &d)
36{
37 using namespace matchit;
38 Id<char const *> i;
39 return match(d)(
40 // clang-format off
41 pattern | ds(2, i) = expr(i),
42 pattern | _ = expr("not matched")
43 // clang-format on
44 );
45}
46
47// #if __cplusplus > 201703L
48static_assert(getSecond(DummyStruct{1, "123"}) ==

Callers 2

customDs.cppFile · 0.85
mainFunction · 0.85

Calls 3

matchFunction · 0.50
dsFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected