Simple implementation of a list in C++ for a prior class