4 ms·
Void is just another name for the empty set. It's not an empty set, it's the empty set. Since it has no members it indeed cannot be instantiated. As a Rust lib
by kaoD 7y ago
Void is just another name for the empty set. It's not an empty set, it's the empty set. Since it has no members it indeed cannot be instantiated.
As a Rust library: https://docs.rs/void/1.0.2/void/enum.Void.html https://docs.rs/void/1.0.2/void/enum.Void.html Notice how the empty enum is called... Void.
In Rust you have "!" (never) too, which cannot be instantiated either but coerces into any other type.
> What is the problem with C++/Java/C#/etc?
Is-a polymorphism.
- crimsonalucard 7y agoPolymorphism? Aren't interfaces a formalization of polymorphism?
- kaoD 7y agoNotice I said "is-a" polymorphism (I should've said inheritance to avoid confusion: class Person; class Employee is-a Person; class Client is-a Person; etc.). I mean an ontology of classes.