Is it possible to overload []
operator twice? To allow, something like this: function[3][3]
(like in a two dimensional array).
If it is pos
An expression x[y][z]
requires that x[y]
evaluates to an object d
that supports d[z]
.
This means that x[y]
should be an object with an operator[]
that evaluates to a "proxy object" that also supports an operator[]
.
This is the only way to chain them.
Alternatively, overload operator()
to take multiple arguments, such that you might invoke myObject(x,y)
.