4 ms·
Although the phrase "pattern matching" is involved these are completely different features. Also, unlike for regular expressions what you actually want here is
by tialaramex 4y ago
Although the phrase "pattern matching" is involved these are completely different features.
Also, unlike for regular expressions what you actually want here is typically a language feature, even if a bunch of the lifting is done in your standard library. In particular you probably want a keyword (or in several C++ pattern matching proposals, more than one) and new behaviour not just a few functions and constants.
You could think of this as a bit like "switch" but on the other hand if your insight into switch is that it's basically a computed go-to wearing fancy dress then no, not that, the thing ordinary people use switch for.