C++ tree realisation