Re:Improving Interoperability Between Rust and C++
by Ericson2314 on Monday February 05, 2024 @03:34PM
(#39266768)
No. &mut dyn Foo is sugar for something like
struct DynFoo<erase T> {
vtable: &mut VTableFoo<T>
ptr: &mut T
}
This is the underlying feature. `dyn` is a bit of an ad-hoc hack around not having this feature.
Would it be a stack allocated, owning version of that, that can be moved? A pure `dyn Trait`?