What would break if class was merged with struct

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat May 27 11:34:45 PDT 2017


On Saturday, May 27, 2017 16:37:04 Ola Fosheim Grøstad via Digitalmars-d 
wrote:
> > Monitor (i.e. for "synchronized") and
>
> Wasn't this going to be removed?

There was definitely talk of doing it, but it's never actually happened. I
don't think that it was actually decided that we would though, and some
other things that we _definitely_ decided we do have never actually happened
either (e.g. remove delete from the language and remove toString, toHash,
opCmp, and opEquals from Object). Getting major changes in is often
something that doesn't work out very well given the obstacles involved.

I don't recall what the obstacles to getting the monitor changes in where,
but I suspect that in order to get them in, someone would effectively have
to champion the changes and push them through, and while I think that there
was someone trying to do that at one point, they seem to have given up on
it. I don't know if they ran into insurmountable problems or simply gave up
and left. But as long as D classes have a built-in monitor, then that's one
of the key differences between a D class or struct (or a D and C++ class for
that matter).

- Jonathan M Davis




More information about the Digitalmars-d mailing list