I have no problem with overloading operator [] for matrix, but how can I overload it for 3D array, to use code like this array[2][3][1]
?
Asked
Active
Viewed 82 times
0

Binary Mind
- 309
- 3
- 13
-
http://stackoverflow.com/a/2216055/179910 – Jerry Coffin Jun 10 '15 at 22:37
-
It's essentially the same approach with one more hop of indirection. – πάντα ῥεῖ Jun 10 '15 at 22:45
-
2IF you have a type SomeType variable [10][10][10] define type SomeTypePP and overload its [] to return SomeTypeP and overload SomTypeP [] operator to return SomeType. – Michael P Jun 10 '15 at 22:47