Why are opEquals/opCmp arguments not in or const for Objects?
Jonathan M Davis
jmdavisProg at gmx.com
Sun Mar 17 17:34:14 PDT 2013
On Monday, March 18, 2013 01:20:40 Timon Gehr wrote:
> >> So my question is "Why are the arguments to opEquals and opCmp (for
> >> Objects) not declared in or const?".
> >
> > Because not all valid implementations can be. They shouldn't be in
> > Object anyway.
Yeah. It was agreed that opCmp, opEquals, toString, and toHash would be
removed from Object, since they don't need to be there and cause unnecessary
issues with const, but AFAIK, no work has been done yet to make that that
work. I would of the things that would likely have to be finished first would be
the refactoring of the built-in AAs so that they're templated types
internally, and I'm sure that there are similar roadblocks that will need to
be sorted out. Long term though, none of that needs to be on Object and should
be left to derived classes to add with whatever constness (or @safety or
whatever) that is appropriate for them.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list