Daniel Boelzle wrote:
Hello,
I have problems using wonderful boost::bind with __cdecl member functions like the following:
#include
struct S { void __cdecl foo( int ); };
void bar() { S s; int const n = 5; boost::bind( &S::foo, &s, _1 )( n ); }
... error C2825: 'F::result_type': cannot form a qualified name ...
I am using MSVC Version 13.10.3077 and boost 1.32.0.
This can only happen if your default calling convention is something other than __cdecl. This is very rare and boost::bind does not provide explicit support for __cdecl, relying on it being the default. You can get around the restriction for non-member functions by using bind<void>, but for member functions, since mem_fn does not have __cdecl overloads, it can't be made to work with the current implementation.