|
Boost Users : |
From: Sebastian Weber (sebastian.weber_at_[hidden])
Date: 2006-08-29 12:51:35
Hello everybody!
I ran into a very weird problem with boost::bind and boost::function. I
am using boost 1.33.1 with a g++ 4.0.3 on a Ubuntu dapper system. The
code which does not compile is:
boost::function< double(double) > pFunc = boost::bind(std::pow, _1, -3);
While this code fragment does:
double f(double k, double p) {
return std::pow(double(k), p);
}
boost::function< double(std::size_t) > pFunc = boost::bind(f, _1, -3);
Ok, I got a solution, but may someone enlighten me what is wrong with
the first version? The error message from g++ is
correlFunc.cpp: In function 'int main(int, char**)':
correlFunc.cpp:184: error: no matching function for call to
'bind(<unknown type>, boost::arg<1>&, double)'
Thanks in advance!
Greetings,
Sebastian Weber
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net