
17 Jan
2017
17 Jan
'17
9:22 a.m.
On 17 Jan 2017, at 10:05, Fu ji <fujimailing@gmail.com> wrote:
I have a problem with boost::function, when I try to assign function to pointer I have a crash. It is simple void function();
I just tried the following code on http://melpon.org/wandbox, it works fine. #include <iostream> #include <boost/function.hpp> void f(void) { std::cout << "Hello World" << std::endl; } int main() { boost::function<void(void)> bf; bf = &f; bf(); } You are also missing critical information, like the boost version that you are using (in my case it was 1.61). I think your question might be better placed on to the boost-users mailing list: http://lists.boost.org/mailman/listinfo.cgi/boost-users Best regards, Hans