I have a function void __fastcall ClassName::FunctionName()
.
I want to create a boost function pointing to that function, using boost::bind. Is this possible? Writing boost::bind(&ClassName::FunctionName, this)
gives compile error "member function must be called or its address taken".
A possible workaround is to create a wrapper function, but this is undesirable because it creates useless extra code:
void ClassName::FunctionName2(){
FunctionName();
}
...
boost::bind(&ClassName::FunctionName2, this);
This can be solved by enabling support for
__fastcall
with a macro:After this, boost::bind syntax works as expected.
This is a non-portable extension, and therefore not enabled by default. Boost::bind documentation.