#include <iostream>
#include <iomanip>
int main()
{
int a = 16;
int b;
a>>1;
b = a>>1;
std::cout << "a=0x" << std::hex << a << " b=0x" << std::hex << b << std::endl;
}
The confusion here is that << and >> do change the operands when used as insertion/extraction operators (ie: cin/cout). But they do not change either operands when used as bitshift operators.
Another reason why I really dislike the overloading of >>/<< for iostream: overloading an operator to do something completely different than what it does originally.