DEV Community


Discussion on: What is an easy bit manipulation technique I can learn in 5 minutes?

lquenti profile image
Lars Quentin

No, it is actually awful please never even think about using it. Modern compiler try to infer semantics, and

X temp = var1;
var1 = var2;
var2 = temp;

is such a known pattern that compiler know that this is a variable switch so theyll optimize it anyways.

And you can read it worse.