DEV Community

Discussion on: Compile-time polymorphism !!

Collapse
 
ithinker profile image
Roman Temchenko

But you cannot assign a different Writer to the variable without changing its type which removes half of the polymorphism value. And there is implicit requirement of the inpl function signature. IMHO you might as well use 2 completely unrelated classes with only implicit relationship is function name. Which could probably be made explicit with macro.