On 12/19/10, bearophile <bearophileh...@lycos.com> wrote: >> See the std.conv.emplace, > > Sorry, see std.typecons.scoped and its problems: > http://d.puremagic.com/issues/show_bug.cgi?id=5115 > > Bye, > bearophile >
Is this another bug?: import std.stdio; import std.typecons; class A { ~this() { writeln("dtor"); } } void main() { { A a1 = scoped!A(); // doesn't call dtor after the scope auto a2 = scoped!A(); // calls dtor after the scope } }