I am in trouble with some of my code. I try for a couple of days to implement an overloaded template method. But it doesn’t runs.
I try to integrate the overloaded template method “T &operator (int i)”, you can see it below.
template <class T>
T &operator (int i)
// <TR> WORKAROUNG: use operator overloading
T getContent(int Index)
ListNode *currentListNode = getListNodeAtIndex(Index);
using namespace std;
List<string> *lst = new List<string>();
for (int i = 295; i < 305; i++)
//lst->getContent(i) = "Test";
string test = lst[i];
If I use “T getContent(int Index)”, It runs. But If I use “T &operator (int i)”, IntelliSense says following: “2 IntelliSense: no suitable user-defined conversion from "List<std::string>" to "std::string" exists c:\development\meteo\application\Application.cpp 26 17 application”
I don’t know why he says this. Also I tried moving T &operator (int i)
Into the ListNode class, but this doesn’t runs, too.
I don’t know, if it is important for you, but I want to store this in a DLL File.
I hope everyone can help me. I am on the way to despair.
I hope you can understand me, my English is not the best.
Dennis Köhler aka Pixma