This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: type traits, reflection, and whatnot


Phil Edwards <phil@jaj.com> writes:

| I'm tempted to suggest that the proposed <type_traits> header look like
| 
|     // Copyright blah blah blah
| 
|     #ifndef _GLIB_the_usual
|     #define _GLIB_the_usual
| 
|     #pragma GCC system_header
|     #pragma GCC type_traits
| 
|     foo
| 
|     #endif

I would suggest that some functionnalities be implemented in the
compiler a la sizeof, e.g. __is_fundamental(T), __is_scalar(T), while
others are implemented at the library level, more or less like
<typeinfo> or <exception>.

| with possibly the primary template declarations where "foo" is.  The compiler
| handles all the "special specializations", which I'm going to call "special
| s13s" or even "ss13s" because "specializations" is getting annoying to
| type out....

There would be little (or no) need for specializations if we choose
the "right" primitives.

| The win is that none of the data structures used to handle the ss13s need
| to be initialized in the compiler unless we see the new pragma.

I do not believe we need pragmas.  I certainly do want it be possible
to use some of the type traits machinery without having to include
whathever header or saying whatever pragmas.

Pragmas are useful when used appropriately, but I'm not sure there are
need or even convenient here.

-- Gaby


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