C++ templates + linked lists... lost.. very lost..
I do not even know how to start debugging this, from the example I have I cannopt see a problem, and the error messages might as well just say hey there was an error go fetch, oh and good luck were as cluseless as you are.
code: Code:
#include <iostream> assign5.cpp:18: syntax error before `*' token assign5.cpp:21: syntax error before `,' token assign5.cpp:24: syntax error before `,' token assign5.cpp:27: syntax error before `,' token assign5.cpp:30: syntax error before `&' token assign5.cpp:33: syntax error before `,' token assign5.cpp:36: syntax error before `,' token assign5.cpp:45: syntax error before `,' token assign5.cpp: In function `void Insert(...)': assign5.cpp:47: syntax error before `;' token assign5.cpp:48: syntax error before `;' token assign5.cpp: At global scope: assign5.cpp:56: syntax error before `,' token assign5.cpp:57: redefinition of `template<class T> void Insert(...)' assign5.cpp:46: `template<class T> void Insert(...)' previously declared here assign5.cpp: In function `void Insert(...)': assign5.cpp:58: syntax error before `;' token assign5.cpp:60: syntax error before `;' token assign5.cpp: At global scope: assign5.cpp:69: syntax error before `,' token assign5.cpp:70: redefinition of `template<class T> void Insert(...)' assign5.cpp:57: `template<class T> void Insert(...)' previously declared here assign5.cpp:70: redefinition of `template<class T> void Insert(...)' assign5.cpp:46: `template<class T> void Insert(...)' previously declared here assign5.cpp: In function `void Insert(...)': assign5.cpp:71: syntax error before `;' token assign5.cpp:73: syntax error before `;' token assign5.cpp: At global scope: assign5.cpp:82: syntax error before `,' token assign5.cpp:83: redefinition of `template<class T> void Insert(...)' assign5.cpp:70: `template<class T> void Insert(...)' previously declared here assign5.cpp:83: redefinition of `template<class T> void Insert(...)' assign5.cpp:57: `template<class T> void Insert(...)' previously declared here assign5.cpp:83: redefinition of `template<class T> void Insert(...)' assign5.cpp:46: `template<class T> void Insert(...)' previously declared here assign5.cpp: In function `void Insert(...)': assign5.cpp:84: syntax error before `;' token assign5.cpp:85: syntax error before `;' token assign5.cpp: At global scope: assign5.cpp:93: syntax error before `,' token assign5.cpp: In function `T Get(...)': assign5.cpp:95: syntax error before `;' token assign5.cpp: At global scope: assign5.cpp:110: syntax error before `,' token assign5.cpp:111: redefinition of `template<class T> T Get(...)' assign5.cpp:94: `template<class T> T Get(...)' previously declared here assign5.cpp: In function `T Get(...)': assign5.cpp:112: syntax error before `;' token |
Fixed that problem.
the problem was in typedef, can't use it.
however now I hit a new problem: Code:
#include <iostream> 43: Could not find a match for 'Insert<T>(Node<double> *,double,string)' in function main() 48: 'MyDouble' is assigned a value that is never used in function main() |
It's quite easy!
There is no matching function predefinition (prototype). take a look at your prototypes: Code:
template<class T> Code:
Insert(Test1, MyDouble, TestName); |
All times are GMT -5. The time now is 07:31 PM. |