C++ multidimensional array operator

后端 未结 7 1313
栀梦
栀梦 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:58

    It is a single operator being used twice to dereference. You can dereference [] operator and perform the functionality and usage by using it as [][] by changing the return type.

提交回复
热议问题