This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [c++, cxx-reflection] Initial thoughts on type reflection.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Phil Edwards <phil at jaj dot com>, gcc at gcc dot gnu dot org
- Date: 10 Mar 2003 06:18:05 +0100
- Subject: Re: [c++, cxx-reflection] Initial thoughts on type reflection.
- Organization: Integrable Solutions
- References: <20030310032049.GA26997@disaster.jaj.com><87bs0j3n1m.fsf@egil.codesourcery.com>
Zack Weinberg <zack at codesourcery dot com> writes:
| Phil Edwards <phil at jaj dot com> writes:
|
| > Gaby and I have been discussing this in private, on and off, for a few weeks.
| > I've made 3 or 4 implementations with varying tradeoffs. Even though the
| > cxx-reflection-branch is experimental, it would nice to get some public
| > discussion before any code starts getting checked in.
|
| Is this intended for C as well as C++? I can certainly see uses -
| <tgmath.h> for instance.
Yes, one of the goals is to have something sharable with C -- most of
the time. For example, in private, I've insisted not having C++
template syntax where not necessary.
| Your magic reflection expressions want to be (extended) integer
| constant expressions, and in particular suitable for use in template
| parameters. Which I bet you've already thought of, but it does mean
| that there are ABI implications here.
Sure, there always are ABI impliciations of any sort everywhere :-)
And we're thinking about them.
| > enum __CVQualifier__
| > {
| > __cv_none, __cv_const, __cv_volatile, __cv_restrict,
| > __cv_const_volatile, __cv_const_restrict, __cv_volatile_restrict,
| > __cv_const_volatile_restrict
| > };
|
| 1) Calling these "CV" qualifiers is inappropriate: it's an
| abbreviation for "const or volatile" and now we have restrict too.
| Suggest you just call them qualifiers and use __qual_ as a prefix.
Background conflict, I presume :-)
C calls these things "type qualifiers", C++ calls them "cv-qualiifers"
(yes, C++ does not officially have 'restrict', but even in the case it
will incorporate it I bell it will call this caterory "cv-qualifier").
Since "qualified" is already in use in C++ with another different
meaning, if we're going to adopt something clear, I'll suggest
__TypeQualifier__
| 2) These should be bitmasks, so you can write
That was intended, at least as I envisioned it.
-- Gaby