This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 53301


Hi,
Yes, please. It feels as if the names are based more on the underlying
implementation of the macro than on anything else. Also, short names
are nice, but using MEM instead of MEMBER is a bit too short. The same
for OB for object and others.

PTR_OR_PTRMEM sounds to me like "pointer or pointer to member", which
sounds redundant since a pointer to member is a pointer already.

And there is also TYPE_PTRMEM_P and TYPE_PTR_TO_MEMBER_P. From the
names it is not clear what is the difference. This could be
TYPE_PTR_TO_DATA_MEMBER and TYPE_PTR_TO_ANY_MEMBER. The few extra
chars help a lot to clarify the meaning.
Let's see if we can do something *now* ;) My concrete proposal would be:

TYPE_PTRMEM_P rename to TYPE_PTRDATAMEM_P (consistent with TYPE_PTRMEMFUNC_P)
TYPE_PTR_TO_MEMBER_P rename to TYPE_PTRMEM_P


and then finally

#define TYPE_PTR_OR_PTRMEM_P(NODE) \
    (TYPE_PTR_P (NODE) || TYPE_PTRMEM_P (NODE))

and use it everywhere. Sounds like an improvement?

Additionally, we could maybe rename PTRMEM_OK_P to PTRMEMFUNC_OK_P

Thanks,
Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]