auto scope problem
Matti Niemenmaa
see_signature at for.real.address
Tue Dec 4 12:46:58 PST 2007
Jarrett Billingsley wrote:
> If you use any of the following:
>
> scope Test t = new Test();
> scope t = new Test();
> auto Test t = new Test();
>
> it uses RAII, but it shouldn't for the last case. Notice:
>
> Test t = new Test();
> auto t = new Test();
>
> _do not_ use RAII as expected.
>
> That "auto Test t" seems to be a bug. Probably been there for ages.
It's there for backwards compatibility. Before 'scope', one had to use exactly
that form to get RAII.
Of course, it's arguable whether it should be kept, but I'm fairly sure it's
intentional.
--
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi
More information about the Digitalmars-d-bugs
mailing list