Question about RAII.
Hasan Aljudy
hasan.aljudy at gmail.com
Wed Jul 5 17:22:55 PDT 2006
Peter C. Chapin wrote:
<snip>
> In the example above it looks like both object1 and object2 are
> destroyed and thus the returned reference is invalid. However, if I
> remove 'auto' from the local declarations than object1 and object2 don't
> get destroyed until garbage collection time... which is too late. It
> looks like I'm left with explicitly deleting the object that I don't
> return, but this is manual resource management and not RAII.
>
> Peter
I always had the impression that RAII indeed *is* manual resource
management.
More information about the Digitalmars-d
mailing list