How do you implement general multidim arrays in C++ with [] operator?