Topic: typename?


Author: willer@carolian.com (Steve Willer)
Date: 1996/03/08
Raw View
I saw in the brochure for Borland C++ 5.0 that it will include support for
numerous new C++ features, including the "typename" keyword. Could anyone
enlighten me as to what that is? I couldn't find it in the April WP.

This isn't equivalent to the "typeof" keyword that I want so much, is it?
---
[ To submit articles: try just posting with your news-reader.
                      If that fails, use mailto:std-c++@ncar.ucar.edu
  FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu.
]





Author: b91926@fsgi01.fnal.gov (David Sachs)
Date: 1996/03/09
Raw View
willer@carolian.com (Steve Willer) writes:

>I saw in the brochure for Borland C++ 5.0 that it will include support for
>numerous new C++ features, including the "typename" keyword. Could anyone
>enlighten me as to what that is? I couldn't find it in the April WP.

>This isn't equivalent to the "typeof" keyword that I want so much, is it?

The typename keyword can be found in the draft standard. It is used
in template declarations to indicate that the following item is a
type. It is used in several places in the library definitions in a
construct like the following:

// class T is assumed to define a type xx
template <class T> class U
{
  typedef typename T::xx xx; // Makes xx same as type xx in class T
  ...
}
--
***** Listen Americans, the IRS is your taxer,  the IRS is one. *****
David Sachs - Fermilab, HPPC MS369 - P. O. Box 500 - Batavia, IL 60510
Voice: 1 708 840 3942      Deparment Fax: 1 708 840 3785
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]