I was reading the topic Generic Classes .I got stuck at one point .Following is the piece of code
template <class StackType> class stack
{
StackType stck[10];
int tos;
public:
stack() {tos=0;}
void push(StackType ob);
StackType pop();
};
My question is that in template <class StackType> class stack
,
there are two classes made (StackType
and stack
)?
I mean how does the compiler treat this as like making stack a nested class of StackType or something else?