There's a better solution, to your problem: pass an "index object" as the argument to operator[].
So `T& operator[](index_t)`, where `index_t` could just be a tuple.
a[{1, 2}] = 12;
This has virtually the same syntax, will be compiled in the same way by any modern compiler, and lets you create special index types that have invariants (suppose you want i0 < i1).
I disagree. The tuple is an index into an array. The multiplicity of the tuple indicates (literally, in fact) the multiple dimensions of the array. Ie to the coder, it is the index that takes on the multi-dimensionality, not the array.
So `T& operator[](index_t)`, where `index_t` could just be a tuple.
This has virtually the same syntax, will be compiled in the same way by any modern compiler, and lets you create special index types that have invariants (suppose you want i0 < i1).