template<typename Type> double & List_Two_Link<Type>::operator[](int Var_for_search) { List_Two_Link * rec = this->pHead; for (int i = 0; (i <= this->itAmount) && (rec->itIndex != Var_for_search); i++, rec = rec->pNext) { if (i == this->itAmount) { cout << "Object not found" << endl; return NULL; } } return rec->pDate->Get_Result() // Здесь функция возвращает double; } bool Menu(List_Two_Link<Polynom> *& obj) { double Rec = obj[1]; //здесь ошибка ... }
Tell me how to override operator[]
for a doubly linked list. So far for the code above, this error crashes:
There is no suitable conversion function from "List_Two_Link" to "double"
pDate
(type Polynom, it has some values that are returned usingGet_Result()
type double) - Alexander Minyaev