Dmitry Olshansky:
> The problem is designing such classes and then documenting: "you should
> always use it as 'scope' ", is awkward.
If you really want a class to be used as scope only you can do this, see the
error message:
scope class Foo {}
void main() {
Foo f = new Foo;
}
> The second writefln prints garbage. I guess it's because of pointer to
> the long gone stackframe, which is ovewritten by the first writeln.
Yes scope has this and other problems (and I think two of them can be fixed),
but I don't think emplace() is a big improvement.
Bye,
bearophile