void wrote:
I decalre pointer-to-member and it's sizeof iz 12 (in Borland 5) or 4 (in MinGW)? When I debugged code, only parameters pushed on stack is 'this' and call was indirect?
What other 2 dwords are?
Please read link below:
http://www.informit.com/isapi/guide~...de/content.asp
Paragraph:
The Underlying Representation of Pointers to Members
...
Hmm... The above text doesn't explain much and also it contains the
following statement
"Thus, the simplest member function can be represented as a set of two
pointers: one holding the physical memory address of the member
function, and a second pointer that holds the 'this' pointer."
This is, of course, incorrect. Member function pointers in C++ are not
tied to any concrete object and, therefore, do not need to store any
'this' pointers.
In one popular implementation on a 32-bit platform a 8-byte member
function pointer holds two values: a entry point to the function and a
"delta" value used by pointer conversions in hierarchies with multiple
inheritance (adjusting 'this' pointer). This could be exactly what the
author of the above article meant (although I seriously doubt that), but
the current wording is definitely misleading
--
Best regards,
Andrey Tarasevich