| 24 | |
| 25 | template <typename T> |
| 26 | void 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 | |
| 42 | int main() |
| 43 | { |