3 ms·
And you can do the same in Rust with Box<Any>. What Rust doesn't have is the object slicing gotcha, which is probably a language design mistake in C++.
by pcwalton 9y ago
And you can do the same in Rust with Box<Any>. What Rust doesn't have is the object slicing gotcha, which is probably a language design mistake in C++.
- pjmlp 9y agoThat gotcha is yet another flaw inherited from copy-paste compatibility with C. structs being classes with public access by default, with default assignment operator behaving the same way as C code would expect.