On Apr 9, 2015, at 16:05:57, Alex Zavatone <[email protected]> wrote:
> 
> Is there any reasonable case where you'd want a case condition to not have a 
> break statement after it?

Sure, and it happens a lot:

switch(justification) {
        case kLeft:
        case kCenter:
        case kRight:
                DoRegularReflow();
                break;
        case kFullJustifyNormal:
        case kFullJustifyEvenLastLine:
                DoJustifiedReflow();
                break;
}

If I ever have a case that has code AND falls through, I make sure I mark it as 
such in lieu of a break:

case 0:
        Something();
        break;
case 1:
        printf("Hey, it's doing that thing you wanted to know about.\n");
        // Fall through!
case 2: {
        NSString*               s = [self getString];
        
        Blah(s);
        break;
}

--
Steve Mills
Drummer, Mac geek


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to