| 3 | using namespace matchit; |
| 4 | |
| 5 | void sample() |
| 6 | { |
| 7 | int32_t const value = 3; |
| 8 | int32_t const *int_reference = &value; |
| 9 | |
| 10 | int32_t const zero = 0; |
| 11 | |
| 12 | auto const a = match(*int_reference)(pattern | zero = expr("zero"), |
| 13 | pattern | _ = expr("some")); |
| 14 | |
| 15 | auto const b = match(int_reference)(pattern | &zero = expr("zero"), |
| 16 | pattern | _ = expr("some")); |
| 17 | |
| 18 | static_cast<void>(a); |
| 19 | static_cast<void>(b); |
| 20 | |
| 21 | assert(a == b); |
| 22 | } |
| 23 | |
| 24 | int32_t main() |
| 25 | { |