[gnu.g++.help] Follow up to "suppressing this ptr"

hawley@ucrmath.ucr.edu (brian hawley) (12/10/90)

A short bit ago, I posted a message looking for information on ways
to get around the implicit passing of the "this pointer" when you
invoke member functions.  

I've had several questions since, so I want to clarify.

Yes, I do plan to modify the data, but I can actually pass the
instance as an argument to the member function, so I can get
at the data fields that way.  What is screwing me up is that 
I do not wish to cast these void *'s that I'm pulling off a
queue to their respective classes (which would solve the problem
yes, because then I would be calling the function as a member,
rather than directly).  The reason I do not wish to do this, is
because there are many many types of classes on this queue, and
I would prefer not to do a load of casts.  That is why I put
the address of the member function I wanted to invoke in the
data structure that goes on the queue (the pointer to the instance
is there also).

I don't care if the "this pointer" is supressed, or a dummy is passed,
(or perhaps some other method), I just don't want to make a mess
out of the stack.

It seems that this problem is related to the other I posted, which
was in regards to placing signal handlers in classes.  Again, 
the kernal doesn't shove the "this" pointer on the stack when
it invokes a signal handler.  So basically, these two problems
are equivolent.  How to call a member function, without going
through the instance (i.e. directly, as a regular function call),
without screwing up the stack.

Since the problem seems to be prevalent (from the requests I've 
gotten inquiring if I've gotten any information yet), I'll post
a summary (after I verify they work), once I've gotten at least
one idea that works.


Thanks,
Brian

------------------------------------------------------------------------------
Brian N. Hawley                            Internet: hawley@ucrmath.ucr.edu
Dept. of Math & Computer Science           uucp: {ucsd, uci}!ucrmath!hawley
Univ. of Calif., Riverside, CA 92521       phone: (714) 787-4645