|
Boost : |
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2008-07-11 14:58:15
On Fri, Jul 11, 2008 at 7:30 PM, Steven Watanabe <watanabesj_at_[hidden]>
wrote:
> 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.
>
Ah, right, got it now. My misunderstanding was in the point at which
visibility of my pair streaming operator counted. I had thought it was
at the point of invocation of the lambda function, whereas in fact it is
the point of definition of the lambda function (ie in the lambda header).
I guess defining streaming operators outside the namespace in which
the class being streamed is defined is fairly unusual, in fact it probably
only occurs for members of the std namespace in practise, so I have
been unfortunate to bump into an odd set of circumstances.
Thanks to Steven and David for putting me straight on this one.
Rob.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk