This is the mail archive of the gcc@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++, cxx-reflection] Initial thoughts on type reflection.


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


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