Here's a much smaller example that reproduces the problem:
#include <iostream>
#include
#include
namespace foo
{
struct S
{
};
}
using foo::S;
std::ostream& operator<< (std::ostream&, S);
int main()
{
using boost::lambda::_1;
std::tr1::function c = std::cout << _1;
}
This gives similar errors, but if you move struct S from namespace foo
to the global namespace, it works. Similarly, if you move the operator<<
from the global namespace to namespace foo, it works.
So I guess the problem is with where Boost.Lambda looks for the
operator. It seems to only look in the same namespace where the operator
was declared.
I'm not sure how to solve it, unfortunately. Perhaps someone familiar with
the internals of Boost.Lambda can comment.
You may also want to consider using Boost.Phoenix instead. It's supposed to
be a new-and-improved version of Boost.Lambda, perhaps it doesn't have
this problem.
Regards,
Nate