Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-03-09 12:17:33


Peter Dimov wrote:
> Daniel Boelzle wrote:
>
>> Hello,
>>
>> I have problems using wonderful boost::bind with __cdecl member
>> functions like the following:
>>
>> #include <boost/bind.hpp>
>>
>> struct S
>> {
>> void __cdecl foo( int );
>> };
<snip>
> 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.
<snip>

This is not correct. For non-static member functions the default
calling convention is "thiscall" which is more efficient than "cdecl"
(the "this" pointer is passed in a register, and the called function
increments the return stack pointer over the arguments). Personally I
don't see the point in changing the calling convention for a non-static
member function.

Ben.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net