Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Programming (http://www.go4expert.com/forums/programming-forum/)
-   -   error C2955: use of class template requires template argument list in C++/MFC (http://www.go4expert.com/forums/error-c2955-class-template-requires-t19818/)

mfcdoubt 20Oct2009 01:46

error C2955: use of class template requires template argument list in C++/MFC
 
I have following header file defines

test2.h ----------> header file

template<class T>
class temp2
{
public:
temp2();
virtual ~temp2();
};



test1.h ----------> header file

template<class T>
class temp1
{
public:
temp1(temp2<T> (temp2<T> *temp2ptr);
~temp1(temp2<T> ();

protected:
temp2<T> *tempptr;

};


test3.h -------------> header file
class test3
{
public:
test3();
virtual ~test3();

};


template<class T> temp1<T>::temp1(temp2<T> *temp2ptr)
{
tempptr = temp2ptr;
}



main.h ----------> header file

temp1 *maintemp1;
temp2<test3> maintemp2;

and in main.cpp -------> source file I am creating an object for this like given below

maintemp1 = new temp1(&maintemp2);

Now when I compile I am getting error

error C2955: 'temp1' : use of class template requires template argument list

can any body tell me what is the wrong with my code block ..


All times are GMT +5.5. The time now is 12:44.