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

Function print

sample/variantAny.cpp:20–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template <typename T>
20constexpr auto print(T const &v)
21{
22 using namespace matchit;
23 Id<char const *> c;
24 Id<int32_t> i;
25 return match(v)(
26 // clang-format off
27 pattern | as<char const *>(c) = [&] { std::cout << "char const *: " << *c << std::endl;},
28 pattern | as<int32_t>(i) = [&] { std::cout << "int32_t: " << *i << std::endl;}
29 // clang-format on
30 );
31}
32
33int32_t main()
34{

Callers 1

mainFunction · 0.70

Calls 1

matchFunction · 0.50

Tested by

no test coverage detected