This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC / Patch] C++/26099 or front-end support to type traits
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: bonzini at gnu dot org
- Cc: Paolo Carlini <pcarlini at suse dot de>, "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: 13 Mar 2007 11:16:01 -0500
- Subject: Re: [RFC / Patch] C++/26099 or front-end support to type traits
- References: <45F6C6C1.9080507@suse.de> <45F6CA64.2050308@lu.unisi.ch>
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> 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.
agreed.
-- Gaby