Simple data structure C++ implementation