Infix vs prefix syntax: name lookup differences
Operators in C++ are usually considered to be an alternative syntax for functions/methods, especially in the context of overloading. If so, the two expressions below should be synonymous: std::cout << 42; operator<<(std::cout, 42); In practise, the second statement leads to the following error: call of overloaded ‘operator<<(std::ostream&, int)’ is ambiguous As usual, such error message is accompanied with a list of possible candidates, these are: operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) operator<<(basic_ostream<char, _Traits>& __out, char __c) operator<<(basic_ostream<char,