operator [] method

double operator [](
  1. int idx
)

Implementation

double operator [](int idx) {
  if (idx == 0) return left;
  if (idx == 1) return top;
  if (idx == 2) return right;
  if (idx == 3) return bottom;
  throw Exception('bad index');
}