Skip to content

Instantly share code, notes, and snippets.

@klmr

klmr/foo.cpp

Created Feb 19, 2013
Embed
What would you like to do?
Ternary
result = x == "foo" ? foo() :
x == "bar" ? bar() :
x == "baz" ? baz() :
x == "qux" ? qux();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.