help-gplusplus
[Top][All Lists]
Advanced

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

Re: virtual method inheritance question


From: jinxidoru
Subject: Re: virtual method inheritance question
Date: 2 Aug 2006 08:09:29 -0700
User-agent: G2/0.2

> Oh, I am terribly sorry. I didn't realize I am not allowed to speak
> without your permission.
>
It is simply very frustrating when one asks a question and people
answer a different question which has nothing to do with your inquiry,
then tells you that you are lame for doing something.

> In that case, your statement of the problem is a lie:
> you are not doing this:
>
I don't know if I would go so far as to call it a lie.  If you really
want to know what I am doing, here you go.  This class is a daemon
class, so only one instance of the daemon class can exist in any
program.  When the daemon class is instantiated, it saves a static
pointer to the current object.  A "single-instance" state is guaranteed
by an assert() statement.  When the daemon is actually started, the
daemon declares signal handlers for a few of the signals.  These signal
handlers are actually static methods which then call the appropriate
method on the static daemon pointer.

> but instead are doing something else.
>
> If you are doing what I think you are, then it is trivial to modify
> your scheme to call overridden virtual methods without the need
> to first figure out which methods are overridden.
>
Apparently, I am not doing what you think I am doing.  I would just
like a simple way for a base class to check if a given function has
been overridden or not.  The signal handler example is simply an
example.  There are a lot of other uses I could forsee for something
like this.


> To answer your 'actual question':
> - there is no portable way to take address of a virtual function, and
> - even for non-virtual functions, comparing their addresses is
>   non portable: on some platforms (e.g. IA64) 2 function pointers
>   may compare unequal, yet both may point to the same function.
>
Thank you very much for answering the question.


> Hmm, I am not sure what provoked your reaction above, but it
> certainly qualifies *you* as a jerk in my book.
>
There's something that really impedes the mass acceptance GNU/Linux.
Many of the people on these forums and the like don't even realize when
they are being rude or offensive.  Sorry for the rant.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]