Remix.run Logo
▲ nananana9 2 hours ago

My point is that you don't need open polymorphism for the example given, and if you give me another example, I can show you why you don't need it there either -- because you do in fact never need it. It's an XY problem over the set X.

If a programmer is reaching for a library, they want it to solve a concrete task. Nobody wants to subclass your Event type, if I have to do it, you've failed at your job.

▲adev_ 44 minutes ago | parent [-]

> Nobody wants to subclass your Event type, if I have to do it, you've failed at your job.

Because it's well known that subclassing is used only for Event type and never EVER anything else requires polymorphism #irony.

The only part of this discussion where you are right is that closed polymorphism (std:: variant) is better than open polymorphism when it can be applied.

And even there, your proposed implementation is utter garbage that leaks memory and that I would refuse straight away in any PR.