Pointers-to-members

Mark Mitchell mark at codesourcery.com
Tue Feb 22 20:22:58 UTC 2000


>>>>> "Christophe" == Christophe de Dinechin <ddd at cup.hp.com> writes:

    Christophe> Mark Mitchell wrote:
    >>  The ABI document says that a NULL pointer-to-member function
    >> has `ptr == 0'.  It does, not, however say whether or not a
    >> NULL pointer-to-member function also has `adj == 0'.
    >> 
    >> I believe that this should be specified as well so that code
    >> generated to do comparison of pointers to members (of the same
    >> type) looks like:
    >> 
    p1-> ptr == p2->ptr && p1->adj == p2->adj
    >>  and not:
    >> 
    p1-> ptr == p2->ptr && (!p1->ptr || (p1->adj == p2->adj))
    >>  So, I would say:
    >> 
    >> If the pointer-to-member is NULL, both fields are zero.  (Note:
    >> there are no non-NULL pointers-to-members for which the `ptr'
    >> field is non-zero.)

    Christophe>              ^^^^^^^^

    Christophe> I assume you meant "There are no non-NULL
    Christophe> pointers-to-members for which the 'ptr' field is
    Christophe> zero", correct?

Yes.  I apologize for my own idiocy.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list