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
Sebastian Weber
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); ... You have to specify which overloaded version of std::pow() you'd like to use:
boost::function
participants (2)
-
Andriy Tylychko (mail.ru)
-
Sebastian Weber