Re: Member Functions

From: James Dennett (jdennett_at_acm.org)
Date: 03/30/05

  • Next message: Anthony Borla: "[OT - Win32 Screen Control] Re: Q: Example of ANSI Screen Control Code Use?"
    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


  • Next message: Anthony Borla: "[OT - Win32 Screen Control] Re: Q: Example of ANSI Screen Control Code Use?"

    Relevant Pages

    • Re: is possible to build some pointer array?
      ... These pointers can store the full ... > representation of a pointer to any other object type. ... to an area of memory to store a struct. ... aren't pointers just addresses into memory? ...
      (comp.lang.c)
    • Re: [SLE] 32-bit machines hit physical RAM limit at 4GB?
      ... address the program's issue of allocating more memory than allowed by ... 32-bit/4GiB pointers. ... This is exactly what I've been saying right from the start. ...
      (SuSE)
    • Re: Increasing efficiency in C
      ... > pointer for its representation of strings. ... Pointers cannot be bounded or unbounded, ... String constants are represented by an array. ... > memory scan searching for a zero that ends the string. ...
      (comp.lang.c)
    • Re: Increasing efficiency in C
      ... > pointer for its representation of strings. ... > memory scan searching for a zero that ends the string. ... Any pointers to it would cease to be valid ...
      (comp.lang.c)
    • Re: Is this math test too easy?
      ... communications glitch; one of the more laughable cartoons ... (A note on "in memory", which for virtual memory machines can get ... Or one can interpret the character string as one of the values ... DOS allowed NULL pointers; the value was in fact interpreted as ...
      (sci.math)