Nevermind, I've solved it. Sorry
Solution:
using boost.bind:
bind(eventFunction, loginServer, _1, _2, _3)(data, dataLength, sourceSystem);
I have the following problem:
Code:
typedef void (LoginServer::*LoginServerMemberFunction)
(unsigned char* data, unsigned int dataLength, SystemAddress sourceSystem);
// I have a class with the following members:
LoginServer* loginServer;
LoginServerMemberFunction eventFunction;
Now I want to invoke the function stored in eventFunction on the instance stored in loginServer. I think this is what mem_fun is for, but from what I could see, it can only call functions with 1 parameter.
I tried:
Code:
mem_fun(eventFunction)(data,dataLength,sourceSystem);
but got the error:
.\LoginServerEventFunction.cpp(20) : error C2784: 'std::const_mem_fun1_t<_Result,_Ty,_Arg> std::mem_fun(_Result (__thiscall _Ty::* )(_Arg) const)' : could not deduce template argument for '_Result (__thiscall _Ty::* )(_Arg) const' from 'LoginServerMemberFunction'
C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(595) : see declaration of 'std::mem_fun'
.\LoginServerEventFunction.cpp(20) : error C2784: 'std::const_mem_fun_t<_Result,_Ty> std::mem_fun(_Result (__thiscall _Ty::* )(void) const)' : could not deduce template argument for '_Result (__thiscall _Ty::* )(void) const' from 'LoginServerMemberFunction'
C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(586) : see declaration of 'std::mem_fun'
.\LoginServerEventFunction.cpp(20) : error C2784: 'std::mem_fun1_t<_Result,_Ty,_Arg> std::mem_fun(_Result (__thiscall _Ty::* )(_Arg))' : could not deduce template argument for '_Result (__thiscall _Ty::* )(_Arg)' from 'LoginServerMemberFunction'
C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(578) : see declaration of 'std::mem_fun'
.\LoginServerEventFunction.cpp(20) : error C2784: 'std::mem_fun_t<_Result,_Ty> std::mem_fun(_Result (__thiscall _Ty::* )(void))' : could not deduce template argument for '_Result (__thiscall _Ty::* )(void)' from 'LoginServerMemberFunction'
Which seems to confirm that it only takes 1 argument at most (if I understand correctly).