
31 Jul
2008
31 Jul
'08
12:15 a.m.
AMDG Erzengel Des Lichtes wrote:
int __cdecl main(int argc, char* argv[], char* envp[]) { boost::function<void(*)(int*)> MyFunc; }
I get the following error message:
(Project Directory)\boostfunctest.cpp(11) : error C2079: 'MyFunc' uses undefined class 'boost::function' with [ Signature=void (__stdcall *)(int *) ]
boost::function requires a function signature. If you have a function pointer, you need to use #include <boost/type_traits/remove_pointer.hpp> template<class FunctionPointerType> void foo() { boost::function<typename boost::remove_pointer<FunctionPointerType>::type> f; } In Christ, Steven Watanabe