On 11/12/13 4:53 PM, Oren Ben-Kiki wrote:
"Your solution does not match the performance of single inheritance,
because it has virtual method calls for every field access from the
"outside" of the trait."

Sorry, I don't follow.

Access to members from outside of the traits would require accessing the
concrete type. Since the approach I described used source
transformation, then this would just be a normal data member access, as
efficient as single inheritance.

Oh, source transformation. I didn't read closely. That won't work as a replacement for single inheritance because it doesn't provide truly existential types--for example, an array of heterogeneous objects all of which share a common prefix.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to