61
I want to toggle a variable between 0 and 1. If it's 0, I want to set it to 1, else set it to 0.
This is such a fundamental operation that I write so often I'd like to investigate the shortest, clearest possible way of doing it. Here's my best so far:
v = (v == 0 ? 1 : 0);
Can you improve on ...