This is the mail archive of the 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

Paolo Bonzini <> writes:

| > 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,

I was hoping that we would not need to use C++ template syntax.  I was
hoping that the actual syntax should be C compatible

   __trait__(T, __has_trivial_constructor__)

where the first argument is a type, and the second could be made an
enumeration (known to the compiler), or just identifiers à la
offsetof, or GNU C attributes; with __trait__ itself a built in
function as apposed to a keyword.


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


-- Gaby

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