| 17 | } |
| 18 | |
| 19 | constexpr bool symmetricArray(std::array<int32_t, 5> const &arr) |
| 20 | { |
| 21 | using namespace matchit; |
| 22 | Id<int32_t> i, j; |
| 23 | return match(arr)( |
| 24 | // clang-format off |
| 25 | pattern | ds(i, j, _, j, i) = expr(true), |
| 26 | pattern | _ = expr(false) |
| 27 | // clang-format on |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | static_assert(symmetricArray(std::array<int32_t, 5>{5, 0, 3, 7, 10}) == false); |
| 32 | static_assert(symmetricArray(std::array<int32_t, 5>{5, 0, 3, 0, 5}) == true); |
no test coverage detected