| 2 | #include <iostream> |
| 3 | |
| 4 | constexpr bool isValid(int32_t n) |
| 5 | { |
| 6 | using namespace matchit; |
| 7 | return match(n)( |
| 8 | // clang-format off |
| 9 | pattern | or_(1, 3, 5) = expr(true), |
| 10 | pattern | _ = expr(false) |
| 11 | // clang-format on |
| 12 | ); |
| 13 | } |
| 14 | |
| 15 | static_assert(isValid(5)); |
| 16 | static_assert(!isValid(6)); |
no test coverage detected