Interfacing D to Legacy C++ Code: A summary of a competing language's capabilities

Templates are going to be pretty hard, because C++ templates (like D’s, Nim’s, etc.) are all ad-hoc rather than strongly typed (based on typeclasses) as in Rust. But you might be able to do the same trick whereby you convert templates into generics and then specify how to do the name mangling, at least for a “well-typed” subset of templates. I dunno how much existing C++ code could actually be made to fit into Rust’s trait system.

1 Like