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

Function print

sample/visit.cpp:26–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25template <typename T>
26void print(T&& x)
27{
28 using namespace matchit;
29
30 match(x)(
31 visit<std::string>(
32 [](const std::string& text) {
33 std::cout << "Text message: " << text << std::endl;
34 }),
35 visit<int32_t>(
36 [](const int32_t num) {
37 std::cout << "Number: " << num << std::endl;
38 })
39 );
40}
41
42int main()
43{

Callers 1

mainFunction · 0.70

Calls 1

matchFunction · 0.50

Tested by

no test coverage detected