Skip to content
Discussion options

You must be logged in to vote

Constants are side-effect-free. So the compiler is free to compile the switch however it wants. If there are side effects, then it's not at all clear what the semantics would be for what does or does not get executed.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@HaloFour
Comment options

@The-Futurist
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@The-Futurist
Comment options

Answer selected by The-Futurist
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants