Reputation: 43
Im new to c++ and its developing i have used Templetes there where i use
typename and templete i got error which says Expected a qualified name after 'typename'
please find my code below. and I would be very grateful if anyone could point out my stupidity. Thanks
class LapIplImage{
private:
IplImage *m_img;
public:
////////////////////////////////////////////////
// construct
LapIplImage():m_img(NULL){}
LapIplImage <typename type>(int width, int height):m_img(0){ Create(width, height); }
~LapIplImage(){ Release(); }
//Expected a qualified name after 'typename'
Upvotes: 2
Views: 4856
Reputation: 602
You forgot the word "template":
1.
class LapIplImage{
private:
IplImage* m_img;
public:
////////////////////////////////////////////////
// construct
LapIplImage():m_img(nullptr){}
template <typename type> LapIplImage (int width, int height):m_img(0){ Create(width, height); }
~LapIplImage(){ Release();}
};
Upvotes: 3
Reputation: 1
You can not use name that is used as identifier.
So you can try some word that is not used by system .
Like typ or TypE .
Upvotes: -1