lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

OK completely off topic but hey ho, I will keep it short.

On 9 March 2011 20:45, Patrick Rapin <> wrote:
I don't understand the need for this one.
 - an empty class with just one virtual function (normally the same
size as a pointer)

Sometimes names can be deceptive :)
 class empty_abstract_class { virtual int member(); };

  C++ in fact forbids cast from a regular pointer to a member
selector (or the other way).
Actually from/to any pointer to member. (I was corrected recently on the definition of pointer to member)

My conclusion is, you can nearly always assume the size of a data
pointer is the same as a function pointer.
In a Posix compliant world this is a guarantee and it is required by dlsym.