Reverted const correctness on object.d

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 13 16:19:46 PDT 2013


On Sunday, October 13, 2013 14:48:33 Benjamin Thaut wrote:
> Why have all the const correctness fixes to object.d been reverted? I
> couldn't find anything inside the bug ticket.
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=1824

What const correctness fixes? If you're talking about the failed fix at the end 
of that bug. I don't know. I'd have to dig through what it did. But the fix 
that was agreed upon in the last major discussion on Object's const-
correctness was to remove opEquals, opCmp, toHash, and toString from Object so 
that derived classes could put whatever attributes they want on them. They're 
completely unnecessary on Object, since we can templatize all the druntime 
stuff that uses them, and having them on Object is causing problems. But that 
hasn't gotten very far yet, at least in part, because changing the AA stuff 
that would have to be changed is quite messy, and probably in greater part, 
because AFAIK not much of anyone has been working on it.

There are four enhancement requests open for this (one for each function):

http://d.puremagic.com/issues/show_bug.cgi?id=9769
http://d.puremagic.com/issues/show_bug.cgi?id=9770
http://d.puremagic.com/issues/show_bug.cgi?id=9771
http://d.puremagic.com/issues/show_bug.cgi?id=9772

I have an open pull request for druntime which improves the opEquals 
situation, but it hasn't been merged yet:

https://github.com/D-Programming-Language/druntime/pull/459

This was the most recent discussion on a way to transition those functions off 
of Object:

http://forum.dlang.org/post/mailman.214.1369617617.13711.digitalmars-d@puremagic.com
http://forum.dlang.org/post/mailman.280.1369712394.13711.digitalmars-d@puremagic.com

- Jonathan M Davis


More information about the Digitalmars-d mailing list