Jason wrote:
int x = 99; boost::thread thrd1(boost::bind<void>(&sender, _1)(x));
and several other combinations including removal of <void>. In the above case, gcc results in /mnt/shared/Projects/boosttest/src/bounded_buffer.cpp:77: error: call of overloaded `bind(void (*)(int), boost::arg<1>&)' is ambiguous /usr/include/boost/bind.hpp:1132: note: candidates are: boost::_bi::bind_t
boost::bind(F, A1) [with R = void, F = void (*)(int), A1 = boost::arg<1>]
I am having a very similar (I think) problem.
Namely, I'm playing with the Spirit library. I started with
the comma-separated-real-number-parser from the examples
but wanted to use my own semantic action:
void F (vector<double> &v, double x) {
v.push_back(x);
}
the core function is:
bool parse_numbers(char const* str, vector<double> &v) {
return parse(str,
real_p[bind<void>(&F,v,_1)] >>
*(',' >> real_p[bind<void>(&F,v,_1)]),
space_p).full;
}
on both lines with "bind" I get:
test.cpp: In function `<snip>':
test.cpp:19: error: call of overloaded `