Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

template as member variable of view class ????

Status
Not open for further replies.

ArvindKumar17

Programmer
Jan 7, 2003
13
MU
Hi friends,
How do I put a template as a member variable in VC++.
I even have a program where this is possible but I am unable to do it in a new application.

Here goes the code . . .

regards
gunheaa@softhome.net
 
If the template class has a default constructor, it's as easy as declaring a member:

private: //or whatever
templateClass< classWithDefConstruct > variableName;

If the template class needs an arguement, then you declare the member as above, but ininialize it in your class' constructor like this:

myClass::myClass() : templateClass( arguement )
{
//blah blah
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top