pass-by-ref semantics for structs (was Deque impl.)

Jonathan M Davis jmdavisProg at gmx.com
Thu Jan 31 08:16:02 PST 2013


On Thursday, January 31, 2013 10:39:46 Andrei Alexandrescu wrote:
> On 1/31/13 10:27 AM, monarch_dodra wrote:
> > On Thursday, 31 January 2013 at 15:12:52 UTC, Andrei Alexandrescu wrote:
> >> As far as I can tell classes have the same problem.
> >> 
> >> 
> >> Andrei
> > 
> > Regarding classes, would there be any chance of being to create a class
> > instance that isn't a child of "object"?
> 
> Using classes entails buying into an entire object model with its own
> pluses and minuses. Adding classes that don't inherit Object would wreck
> havoc all over the place.

And what would be the gain, anyway?

I don't understand what the downside is to having a single base object besides 
the issues with toString, toHash, opEquals, and opCmp. And we decided to 
remove all of them from Object (though no actual progress has been made beyond 
the decision), and with those gone, Object will have next to nothing on it 
anyway. But not having Object be the base of all classes would definitely cause 
quite a few problems.

- Jonathan M Davis


More information about the Digitalmars-d mailing list