switch()

Daniel Murphy yebbliesnospam at gmail.com
Thu Feb 20 07:13:27 PST 2014


"Steven Schveighoffer"  wrote in message 
news:op.xbk44onleav7ka at stevens-macbook-pro.local...

> What I really would be curious about is if in most D code, you see a lot 
> more default: break; than default: assert(0);

I just did a quick git-grep on the compiler source (not D, but all switches 
do have a default thanks to the d port)

With 707 "default:"s 68 had a break on either the same or next line, and 249 
had an assert(0).

On phobos I get 22 assert(0)s vs 10 breaks with 147 defaults

With druntime i get 24 assert(0)s + 5 error();s vs 11 breaks with 64 
defaults. 



More information about the Digitalmars-d mailing list