Programming, Swift, Object Oriented, Objective C.
will not work. typedef struct DisplayCanvas { ColorSpace colorSpace; Canvas super; } DisplayCanvas; // We can not safely cast DisplayCanvas to Canvas Another approach to inheritance would be using union and enum in base structure to identify the type. typedef struct DisplayCanvas { ColorSpace