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?
The syntax would be
return this->operator[](i);
or more canonically
return (*this)[i];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With