Thoughts from newcommer
Stanislav Blinov via Digitalmars-d
digitalmars-d at puremagic.com
Mon Apr 17 09:06:20 PDT 2017
On Monday, 17 April 2017 at 15:24:26 UTC, Jerry wrote:
> It has everything to do with @nogc, if it isn't @nogc then it
> is using the garbage collector and even if it is using
> Destroy() it is still invoking the GC and something is still
> going to have to be freed by the GC, even if that class is
> empty. You can't say it is RAII if it is using the GC, that's
> just nonsense. So it is not just for convenience.
On the contrary. All RAII does is establish a relation between
resource lifetime and another resource's (e.g. object's)
lifetime. It doesn't necessarily have to be limited to any
particular scope.
> Not to mention for some reason Array's internal implementation
> is ref counted. If you want ref counted arrays you should do
> RefCounted!(Array!T). Std.containers is just a giant mess.
The "some reason" is mutable slices.
> I feel like if your solution is, don't use Phobo's containers
> here use this person's that isn't updating it anymore of
> questionable quality. Then I feel like you are agreeing with me
> that phobos containers suck. Oh and it looks like hackerpilot
> is responsible for merging pull request, lovely.
Yes, std.container does need quite a bit of love. That doesn't
mean that D doesn't have RAII or that it's RAII support is
somehow deficient.
More information about the Digitalmars-d
mailing list