switch()

Steven Schveighoffer schveiguy at yahoo.com
Thu Feb 20 06:45:19 PST 2014


On Wed, 19 Feb 2014 09:17:58 -0500, QAston <qaston at gmail.com> wrote:

> On Wednesday, 19 February 2014 at 14:14:01 UTC, Ary Borenszweig wrote:
>> auto a = ...;
>> switch(a) {
>>   case 1: a += 1;
>>   case 2: a += 2;
>>   // In other cases, leave "a" as is
>> }
>
> Just put default: break instead of that comment, it's shorter that way:P

I think the comment was meant as an explanation to you, not something that  
would actually be in the code :)

-Steve


More information about the Digitalmars-d mailing list