There is no difference for unsigned
. However, there would be a difference for classes with overloaded operator++
, because it would call its different overloads (usually, the postfix operator creates a copy of the class, which means it may be slower).
Would using >>= 1U instead of /=2 make any difference?
Probably not. Its semantics are the same for unsigned, and the compilers usually treat them equally and can change one into another if it's faster.