Herb Sutter's CppCon talk "Extending and Simplifying C++: Thoughts on Pattern Matching using `is` and `as`"

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Nov 1 16:26:47 UTC 2021


On Monday, 1 November 2021 at 08:15:55 UTC, Araq wrote:
> What? Pattern matching doesn't scale/nest well because you 
> think it's like try-catch? That's major news to all C#, F#, ML, 
> Ocaml, Rust, Swift, Elixir programmers...

It scales, but how do you know if you remembered to test all 
types? If you forgot one, you'll get a runtime-crash. So you need 
something more powerful, something that can statically verify 
that you cover all relevant types (like a formalization of a set 
of types).

Then again, I am not really sure how often you need to test more 
than a handfull types in a well designed program, in which case 
if-then-else is sufficient…



More information about the Digitalmars-d mailing list