2 ms·
Why boxed? just change to vec::<&dyn animal> and push reference of Dog to vec ,it should work. Isnot &dyn animal trait object?
by gerryxiao 8y ago
Why boxed? just change to vec::<&dyn animal> and push reference of Dog to vec ,it should work.
Isnot &dyn animal trait object?
- albertgasset 8y agoIt works, but the point of the article remains the same because &dyn Animal is also a fat pointer.