Pointers-to-members

Mark Mitchell mark at codesourcery.com
Mon Feb 21 17:58:41 UTC 2000


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.)

Does that sound right?

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




More information about the cxx-abi-dev mailing list