>>373
obj& operator [] (int i) {return elem[i];}
もちろんelem[]の定義はobj elem[];
obj.shape() も実装すると便利