vendredi 27 avril 2018

expected type-specifier C++ template class

So I am trying to implement a Vector class.

I am getting the error "expected type-specifier before '[' token" in my 'at' function, as shown below:

T Vector<T>::at(unsigned i){
    return operator[i]; 
}

I have tried:

return this->operator[i];

and

(*this).operator[i];

but to no avail. Any ideas?

Aucun commentaire:

Enregistrer un commentaire