Repair c++ for snippet