template <class T>
class Array {
int low, high;
T *value;
public:
Array(int l, int h) : low(l), high(h) {
value = new T[high-low+1] - low;
}
~Array() // just say delete to leaks
{ delete [] (value + low); }
T & operator [](int i) {
if (i >= low && i <= high)
return value[i];
else {
// why not just throw an exception here?
error();
return value[low];
}
}
};
//End of File