3 ms·
"The memory layouts are very different." Clarification: the memory layouts between C++ dynamic dispatch and rust dynamic dispatch are very different. Rust imp
by jeffdavis 7y ago
"The memory layouts are very different."
Clarification: the memory layouts between C++ dynamic dispatch and rust dynamic dispatch are very different.
Rust imposes no requirements on the structure layout, whereas C++ adds some magic data. The magic data means it's awkward to make C++ do dynamic dispatch on a C struct pointer; but rust can do dynamic dispatch on a C struct pointer with no problem.