This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Template class help??


Hi all,

I need help with template class. Say I have a template
array class with non-type argument:

template<class D, int size=10> class aType {
   public:
     D *data;
     aType(){data = new D[size]}
     ...
}

What I want to do is use it typedef. If there is no
non-type template argument 'size', just only class D,
I can use typedef aType<int> intarray; But here I
can't use typedef as int can be all integers. Is there
any way to do this? Thanks.

Nyinge

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html


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