Pregunta de entrevista de Envoy

why use typedefs?

Respuesta de la entrevista

Anónimo

20 nov 2016

I blanked out and blurted out a bad assumption that typedefs used by the compiler to protect type safety. The correct answer I didn't give was: typedefs create aliases to existing types and provide clarity and portability to interface definitions. These are used in C, C++ and Objective-C. For Swift, the same thing can be accomplished with typealiases.