What would break if class was merged with struct

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sat May 27 09:37:04 PDT 2017


On Saturday, 27 May 2017 at 16:31:32 UTC, Stanislav Blinov wrote:
> There's a lot more difference in D. Classes in D are fat memory 
> chunks storing pointers to ClassInfo (inc. vtable),

So are classes with virtual functions in C++, to get RTTI you 
need to have a virtual member function. I don't see the big 
difference.

> Monitor (i.e. for "synchronized") and

Wasn't this going to be removed?

> a list of all interfaces they implement,

Semantically roughly the same as multiple-inheritance in C++ but 
more limited.

> If we were to remove all that, we'd lose the semi-natural way 
> of interfacing to C++ classes, and some pretty horrendous code 
> involving void* and void** would have to be used.

I don't understand what you mean here.




More information about the Digitalmars-d mailing list