Mojmir Svoboda writes:
I was intrigued by this problem, but I couldn't solve it myself. I think it
has to do with the tuple (user defined types, overloaded operator<<, Bll).
consider:
typedef int value_t;
typedef std::vector vect_t;
typedef std::pair value_t_pair;
typedef std::vector vect2_t;
value_t make_value_t (value_t v) { return v; }
value_t_pair make_value_t_pair(value_t v) { return std::make_pair(v, v); }
std::ostream& operator<<(std::ostream& ros, const value_t_pair&)
{
return ros;
}
void Foo()
{
vect_t vec;
//compiles
std::for_each(vec.begin, vec.end(),
std::cout << boost::lambda::bind(&make_value_t,
boost::lambda::_1));
//does not compile
std::for_each(vec.begin, vec.end(),
std::cout << boost::lambda::bind(&make_value_t_pair,
boost::lambda::_1));
//does also not compile
std::for_each(vec.begin, vec.end(),
std::cout << boost::lambda::bind
(&make_value_t_pair, boost::lambda::_1));
}
But maybe a Bll guru can give a better answer.