Remove switch case fallthrough

Mike Parker aldacron at gmail.com
Fri May 14 07:00:50 UTC 2021


On Friday, 14 May 2021 at 06:56:55 UTC, Mike Parker wrote:

>
> But C supports implicit fallthrough, so by deprecating it, we 
> did make an exception. Ans it's a good exception to make.

Here's what the C++ Core Guidelines say:

"Always end a non-empty case with a break. Accidentally leaving 
out a break is a fairly common bug. A deliberate fallthrough can 
be a maintenance hazard and should be rare and explicit."

This is the same reason it's deprecated in D.


https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es78-dont-rely-on-implicit-fallthrough-in-switch-statements


More information about the Digitalmars-d mailing list