The code you publish is not valid in C ++ 03 (that is, what was the C ++ language standard until September 2011). In C ++ 03, there is only one operator>> overload, which can be considered here. [I deleted all the template code because it doesn't matter]:
istream& operator>>(istream&, string&);
Note that the std::istream is a non-constant reference, so you cannot use the temporary std::istream . In your code, you are trying to use a temporary object there.
In C ++ 11 (i.e., the current C ++ language language) there is an additional overload that takes an std::istream by rvalue reference. This allows you to either temporarily pass through this parameter.
Visual C ++ already supports this C ++ 11 feature, so, as Benjamin Lindley points out in a comment, your code will really compile if you use Visual C ++ 2010 or later. Your Clang assembly can support this if you use the -std = C ++ 0x flag.
source share