I need to turn this code for a class that checks for a out-of-bound value:
class array
{public :
int & operator [] (int); // Prototype; overloaded operator
int size () // In-line function
{return ub - lb + 1;
};
int lbound ()
{return lb;
};
int ubound ()
{return ub;
};
list = new int[10]; // Constructor
list (); // Default constructor
array (int)
private :
int *list // Arrays of size 9;
int lb; // Lower bound of array; set by user
int ub; // Upper bound of array; set by user
};
into a template. Im not sure how i would even start this. any help would be great