They aren't identical (at least prior to C++11) because the last >>
characters are parsed as a single operator (operator>>
). Putting a space between them causes the expected behavior.
The same situation happens where the compiler parses <:
as the beginning of a tigraph/digraph. For example:
N<::T> // <: parsed as [
A space separating the operators causes the code to work fine.