The "if" is redundant. Also, the >> will cause a compiler error on pre-C++11 compilers, see the line above.