question about overloading operators
Code:
   const complex<T>& operator [](int i) const { return data[i]; };
   cvector operator +(cvector& A) {  // ADDITION OPERATOR
      cvector result(A.size);  // DO NOT MODIFY THE ORIGINAL
      for (int i = 0; i < size; i++)
          result[i] = data[i] + A.data[i];
      return result;
      };
why is it that you cannot reference the class' overloaded operators, namely the [] operator; like so:
Code:
const complex<T>& operator [](int i) const { return data[i]; };
cvector operator +(cvector& A) { // ADDITION OPERATOR
cvector result(A.size); // DO NOT MODIFY THE ORIGINAL
for (int i = 0; i < size; i++)
result[i] = this[i] + A[i];
return result;
};
?
why is it that you can use the bracket operator for result, but not A or this?