rewriting my data-structures java class as c++11 code