News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by gpderetta on Thursday October 01, 2020 @07:16AM (#24649601)
They are still different: 'using', 'with' are tied to scope, RAII is tied to lifetimes which in turn can be tied to scope but do not have to. It also applies to every object and subobject transitively and implicitly, without having to implement some special protocol [1].

[1] if you are implementing something like a container and dealing to raw memory you might need to call destructors of subobjects explicitly, but because it is needed to correctly reclaim memory, it is almost always done and all standard containers do it already. On the other hand in python list doesn't implement the context manager protocol.

There are no comments on this comment yet.