2 ms·
That would be lovely, but it would give you “spooky action at a distance” where some large struct adding an impl for some trait would change the size of a data
by josephg 2y ago
That would be lovely, but it would give you “spooky action at a distance” where some large struct adding an impl for some trait would change the size of a data structure in another unrelated part of the program.
But it would be nice if there was some unification of the idea of an enum where every variant implements a trait and &dyn Trait. Basically, an enum made up of a set of named structs where each struct implements a specific trait could be a lovely concept.