In general, the question in the title, I do not know what else to add, except for an example
Overload as a member of a class:
class A { public: int* some_arr; int operator [](uint_t i) { return this->some_arr[i]; } } Overload, as I imagine, as not a member of the class:
class A { // ... public: int* some_arr; // ... } int operator [](const A& a, uint_t i) // либо поменять аргументы местами, поэтому-то и не уверен { return a.some_arr[i]; } And if you overload as a non-member of a class, then, it turns out, you need to pass an instance, but first you need to pass an instance, and then an index, or vice versa? Or not at all?