c++ restructure