T
tropos
I'm trying to use the 'typedef templates' idiom, mentioned in
Alexandrescu's work on templates. Here's a Dr Dobbs article from 2002
that says they are a proposed C++ standard:
http://www.ddj.com/cpp/184403850
My compiler (Visual Age C 6.0) rejects them. Are they supported? Were
they ever introduced into the language standard?
Here is an example:
template<typename A, typename B> class X { /* ... */ };
template<typename T> typedef X<T,int> Xi;
Xi<double> Ddi; // equivalent to X<double,int>
The compiler flags the second line with an error: "A typedef
declaration must not be a template."
(Please reply to this group.)
Alexandrescu's work on templates. Here's a Dr Dobbs article from 2002
that says they are a proposed C++ standard:
http://www.ddj.com/cpp/184403850
My compiler (Visual Age C 6.0) rejects them. Are they supported? Were
they ever introduced into the language standard?
Here is an example:
template<typename A, typename B> class X { /* ... */ };
template<typename T> typedef X<T,int> Xi;
Xi<double> Ddi; // equivalent to X<double,int>
The compiler flags the second line with an error: "A typedef
declaration must not be a template."
(Please reply to this group.)