Hi, I've got what seems like a simple enough question about templates. What i want to do, is take the type parameter (from the template) in one class and pass that directly to another class. Like this:
Code:
template <class T>
class classone
{
public:
classone(); //constructor
~classone(); //destructor
somefunc(T * myvar)
{
classtwo<T> MyInstancec2(somevar);
}
}
template <class X>
class classtwo
{
public:
classtwo(X mydat) //constructor class 2
{
X * thedataofXtype = &mydat;
itsData = thedataofXtype;
}
private:
X * itsData;
}
The compiler keeps telling me that "there is no appropriate constructor for classone [ X=(some type) ]" where (some type) is the type of variable I pass to T. Any help?
BTW my compiler is VC.net 2003.
All help is greatly appreciated