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: [RFC / Patch] C++/26099 or front-end support to type traits


> I'm attaching below the patch, together with a set of simple testcases,
> it seems rather self-explanatory to me and, well, not too ugly, what do
> you think?

I cannot comment on the technicalities but it seems cool!
For the syntax, I'd prefer something like
__trait__<__has_trivial_constructor__> (x) which reminds attributes
(but with a C++ touch on it!) or, alternatively,
__trait__<x> (__has_trivial_constructor__).  It also does not
require the proliferation of keywords in the scanner since you
can parse an arbitrary identifier and compare it with strcmp.

I understand that the usage should be confined in a header file, so
the extra ugliness should not be a problem.

Paolo


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