generate cpp code