error C2955: use of class template requires template argument list in C++/MFC

Discussion in 'Programming' started by mfcdoubt, Oct 19, 2009.

  1. mfcdoubt

    mfcdoubt New Member

    Joined:
    Oct 19, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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 ..
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice