On Tue, Dec 13, 2011 at 9:08 PM, Jonathan M Davis <[email protected]>wrote:
> Is the plan for std.container still to have all of its containers be final > classes (classes so that they're reference types and final so that their > functions are inlinable)? Or has that changed? I believe that Andrei said > something recently about discussing reference counting and containers with > Walter. > > The reason that I bring this up is that Array and SList are still structs, > and > the longer that they're structs, the more code that will break when they > get > changed to classes. Granted, some level of code breakage may occur when we > add > custom allocators to them, but since that would probably only affect the > constructor (and preferably wouldn't affect anything if you want to simply > create a container with the GC heap as you would now were Array and SList > classes), the breakage for that should be minimal. > > Is there any reason for me to not just go and make Array and SList final > classes and create a pull request for it? > > - Jonathan M Davis > What happens in cases where you need to extend functionality of those containers by inheritance? With structs you'll have to rely on composition.
