D vs C++ classes?
sighoya
sighoya at gmail.com
Mon Jun 21 17:21:35 UTC 2021
On Monday, 21 June 2021 at 13:40:42 UTC, Ola Fosheim Grøstad
wrote:
> What prevents unifying D classes with C++?
>
> By that I mean: shouldn't it be possible to formulate an ABI
> for D classes that makes them fully C++ compatible?
+1 for that, never understood the reason against this given that
we live in the 20ies now.
If performance is the problem, you wouldn't choose virtual
dispatch anyway.
If safety is the problem, then disambiguation by scoping is the
solution.
> Seems to me that D-interfaces can be implemented with C++ ABI
> for multiple inheritance for instance.
Yes, but interfaces can't have fields. I find D should better
interop with C++ classes without the `extern` sh!t, and
supporting multiple inheritance should work out of the box.
Who wants to manually create thousands of classes to interop with
a c++ framework?
More information about the Digitalmars-d
mailing list