C++ implementation of basic data structures