Hacker News new | past | comments | ask | show | jobs | submit login

"If no converted case constant expression matches and there is no default label, no part of the switch body is executed."

Section 6.8.4.2, item 5 of http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf (page 134)




how is this different from "does nothing"?


... it's not? I was just providing an authoritative reference for the parent's claim.

(Pedantic note: It's technically incorrect to say that the switch statement does nothing.

    switch(FunctionThatDoesSomethingAndReturns1()) {
        case 2:
            // foo
    }
The switch body does nothing, but the actual statement does something.)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: