refract cpp code