Re: Member Functions
From: James Dennett (jdennett_at_acm.org)
Date: 03/30/05
- Previous message: CaptainJ: "Re: How do I do something every x increment in time?"
- In reply to: David White: "Re: Member Functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 21:05:08 -0800
David White wrote:
> "James Dennett" <jdennett@acm.org> wrote in message
> news:cF42e.2128$k57.205@fed1read07...
>
>>David White wrote:
>>
>>>If it's not mandated by the standard, is it ever possible, at least in
>>>theory, for one pointer to a member function (virtual or not) to be not
>>>equal to another pointer to the same member function?
>>
>>They might not have the same representation in memory, but
>>they must compare equal with ==, just like pointers to
>>objects or pointers to functions.
>
>
> So, you're saying that the two pointers might in fact contain different
> addresses (i.e., to different instances of the function), but that the ==
> operation must somehow know that both are addresses of the "same" function?
That would be consistent wrt to the rules of the C++ standard,
though I can't think of any reason why an implementation would
choose to do that.
But what I was actually saying was that two different bit patterns
might point to the *same* instance of a function, just as there
might be two different representations in memory of the same data
pointer (even a null pointer), but == must know if they point to
the same object (or are both null).
-- James
- Previous message: CaptainJ: "Re: How do I do something every x increment in time?"
- In reply to: David White: "Re: Member Functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|