
AMDG Robert Jones wrote:
On Fri, Jul 11, 2008 at 7:08 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
The overload of operator<< for std::pair is not found by Boost.Lambda.
This much I have discovered painfully by trial and error - the bit I don't understand is why!
There are two ways that functions can be found from within a template. The first is the functions which are visible at the point where the template is defined. Your overload of operator<< is not declared when the Boost.Lambda stuff is included, so it won't be found that way. The second way is through ADL. ADL searches /only/ in namespaces associated with the argument types. In this case only namespace std is associated with the argument types, not the global namespace, so operator<< can't be found that way either.
Also, it would be very handy if you can suggest a method of achieving the effect I'm looking for.
There isn't a legal way. The standard forbids adding functions to namespace std. In Christ, Steven Watanabe