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


Benjamin Kosnik <bkoz@redhat.com> writes:

| >I would also like to mention a work-in-progress in the Evolution Working
| >Group concerning "typedef template" and "template aliasing".
| 
| What ever happened to this? I remember the LLNL guys had some
| interesting ideas for using typedef templates in actual code.

His ideas further convinced me that we should not eliminate "template
aliasing" (as opposed to "template typedef" as described in Herb's
paper in the Post Santa Cruz mailing).  That is what, partly, prompted
me to post the message c++std-ext-5658 with Subject: "typedef template
and template typedef".

| Is there
| anyway that one, or both, of the typedef template suggestions could get
| implemented in g++ so that some experimentation could occur before this
| stuff gets cast into stone in the form of a standard?

I believe, and apparently so do other core guys like Daveed
Vandevoorde, that both aliasing mechanisms can co-exist in the
language.

Basically, the two aliasing mechanisms are:

  1) typedef template

    template<typename T, typename U> struct X { /* ... */ };
    template<typename T> typedef <X, int> Y;

    // Every instantiation of Y<T> is a typedef of X<T, int>.
    // No deduction is possible.  The typedef template is a 
    // definition.

  2) template aliasing

     template<typename T, typename Alloc> struct vector { /* ... */ };
     template<typename T> Vec = vector<T, MyAlloc<T> >;

    // Vec<> is an alias for the whole family.  Deduction is possible.
    // The LLNL guy would like to see this feature.

-- Gaby


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