Pointers-to-members

Christophe de Dinechin ddd at cup.hp.com
Tue Feb 22 19:36:05 UTC 2000


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

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


Christophe




More information about the cxx-abi-dev mailing list