If you program in C, you've probably used what is called the ternary operator a million times in expressions like this:
value = user_value ? user_value : default_value;Where you test
user_valueand, if it's non-zero, you store it in
value; otherwise, you set
What you may not know is that, thanks to a gcc (and others) extension, you can abridge that expression to this:
value = user_value ?: default_value;This ?: thing is colloquially named the 'Elvis' operator (if you don't see why, just look at it with you head slightly slanted to the left).