Connecting with C++
This book devoted an entire chapter to connecting D and C, yet there's only this small section here in the last chapter to discuss interfacing with C++. The reason is that this feature of D is, as I write, under active development. Interfacing with C is rather easy, as most C compilers conform to well-defined, standard ABIs. The story is different with C++, where there is no standard ABI. This is particularly an issue when it comes to name-mangling, where compilers have traditionally followed their own schemes. Additionally, there is no such one-to-one correspondence between C++-specific features and D features as there is when C is compared with D. There are also key differences in the languages to consider. For example, C++ supports multiple inheritance, D does not; classes in C++ are value types, while D classes are reference types; D const
is transitive, C++ const
is not; and so on. Most of these issues as yet have no solutions.
Despite all the caveats, there is a...