The problem here is that the point where your call to operator >>
is being made is somewhere inside the std
namespace, and the namespace where the types of the arguments live is std
.
Provided the compiler can find an operator >>
in either the namespace where the call occurs or the namespace where the types of the arguments live (both are the std
namespace in this case), no matter whether it is viable or not for overload resolution (which is performed after name lookup), it won’t bother looking for more overloads of operator >>
in parent namespaces.
Unfortunately, your operator >>
lives in the global namespace and is, therefore, not found.