#include #include "WordArrayT.h" using namespace std; bool WordArrayT::PushBack(DataT newWord){ bool good = false; if (size < capacity) { data[size] = newWord; ++size; good = true; } return good; } DataT & WordArrayT::operator[](size_t index){ return data[index]; } const DataT & WordArrayT::operator[](size_t index) const{ return data[index]; } DataT & WordArrayT::at(size_t index){ if (index < size) { return data[index]; } cerr << "Error: Out of bounds index " << index << endl; return data[0]; } const DataT & WordArrayT::at(size_t index) const{ if (index < size) { return data[index]; } cerr << "Error: Out of bounds index " << index << endl; return data[0]; } size_t WordArrayT::Capacity() const{ return capacity; } size_t WordArrayT::Size() const{ return size; }