Simple data structure in c++