about template
-
about template i create template class <<<<>>>>>>> template struct CTDbNode { T Data; CTDbNode(T Value):Data(Value){} }; <<<<<<>>>>>>>>>> #pragma once #include "m_TemplateData.h" templateclass CTDbList { public: CTDbList() { pCurrent=NULL; } void CTInsert(T Value) { pCurrent=new CTDbNode(Value); } public: CTDbNode *pCurrent; }; example CTDbList d; d.CTInsert(_T("ddd")); error: e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2955: 'CTDbNode' : use of class template requires template argument list e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode' e:\mystudio\project\shared\shared\m_templatestructure.h(11) : while compiling class template member function 'void CTDbList::CTInsert(T)' with [ T=CString ] e:\mystudio\project\shared\shared\cm_selectquery.cpp(6) : see reference to class template instantiation 'CTDbList' being compiled with [ T=CString ] e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2514: 'CTDbNode' : class has no constructors e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode' thank:)
-
about template i create template class <<<<>>>>>>> template struct CTDbNode { T Data; CTDbNode(T Value):Data(Value){} }; <<<<<<>>>>>>>>>> #pragma once #include "m_TemplateData.h" templateclass CTDbList { public: CTDbList() { pCurrent=NULL; } void CTInsert(T Value) { pCurrent=new CTDbNode(Value); } public: CTDbNode *pCurrent; }; example CTDbList d; d.CTInsert(_T("ddd")); error: e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2955: 'CTDbNode' : use of class template requires template argument list e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode' e:\mystudio\project\shared\shared\m_templatestructure.h(11) : while compiling class template member function 'void CTDbList::CTInsert(T)' with [ T=CString ] e:\mystudio\project\shared\shared\cm_selectquery.cpp(6) : see reference to class template instantiation 'CTDbList' being compiled with [ T=CString ] e:\mystudio\project\shared\shared\m_templatestructure.h(12) : error C2514: 'CTDbNode' : class has no constructors e:\mystudio\project\shared\shared\m_templatedata.h(15) : see declaration of 'CTDbNode' thank:)
Tick the "Ignore HTML tags in this message" button when you post: none of the the "<" or ">" characters can be seen in you post and it's poorly formatted. Steve