Operator[]
The performance of []
in C and C++ is different.
e.g., when you excute A[index]
- If A is a object, it will call the operator[]
- If A is a pointer, it is equivalent to A + index
So, operator overloading is invalid to pointer.
[]
The performance of []
in C and C++ is different.
e.g., when you excute A[index]
So, operator overloading is invalid to pointer.