C++ multidimensional array operator

后端 未结 7 1312
栀梦
栀梦 2021-01-05 16:22

it is possible to overload somehow operator for multidimensional array?

Something like:

class A {
  ...
  int& operator[][] (const int x, const i         


        
7条回答
  •  离开以前
    2021-01-05 16:43

    You need to overload operator[] and make it return a new class which only has another operator[].

提交回复
热议问题