// // timelist.cpp // #include "timelist.h" #include // macro to check preconditions using namespace std; void TimeList::add(Time *new_time) { assert(count < MAX); items[count] = new_time; count++; // could write: items[count++] = new_time; } Time* TimeList::get(int ix) const // MUST repeat const here { assert(0 <= ix && ix < count); return items[ix]; // returns copy of object }