Typescript Type Casting In Cpp