Topic: default template types


Author: venkat@lgc.com (Venkat Viswanathan)
Date: Thu, 14 Oct 1993 00:20:33 GMT
Raw View
Having just moved to a compiler which supports templates, we are
in the process of parametrizing some of our classes.

e.g.
class Foo { ... int x ; .... } to
template<class T> class Foo { ... T x ; .... }

As a result all previous code of the form

Foo foo ;

has to be changed to

Foo<int> foo ;

Or as an alternative,

template<class T> class tFoo { ... T x ; .... }
typedef tFoo<int> Foo ;

I was wondering if there are any plans for allowing default Template
types :

template<class T=int> class Foo { ... T x ; .... }

This would make transition easier. The need to parametrize
exisiting classes will arise with new requirements.

I guess forward declarations would still cause problems.
 class Foo ;
would need to change to
 template<class T> class Foo ;

Is there any different syntax being specified for this?
--
--
Venkat Viswanathan - venkat@lgc.com - (713) 560-1201




Author: grumpy@cbnewse.cb.att.com (Paul J Lucas)
Date: Thu, 14 Oct 1993 16:06:02 GMT
Raw View