<div class="gmail_quote">On Thu, Jul 22, 2010 at 00:27, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
The double destructor hits a bug in the compiler implementation. Anyway, here's the committed code:<br>
<br>
<a href="http://www.dsource.org/projects/phobos/changeset/1774" target="_blank">http://www.dsource.org/projects/phobos/changeset/1774</a><br>
<br>
It uses a new idiom that is enabled by auto returns - defines a struct inside the function and returns it. That's a veritable existential type! (<a href="http://stackoverflow.com/questions/292274/what-is-an-existential-type" target="_blank">http://stackoverflow.com/questions/292274/what-is-an-existential-type</a>) I expect more of that idiom in the upcoming commits.<font color="#888888"></font></blockquote>
<div><br>Hmm, so the struct Scoped is implicitly parametrized by T and Args... Cool.<br><br>Why do you put a second layer of (Args...) in Scoped constructor? Why not just<br><br>this(Args args) if (etc) {...}<br><br>And, in your case, if you used Args inside Scoped (which you don't do), would that be the ctor's Args which'd be used?<br>
<br><br>Philippe<br><br>PS: too bad that, if bug 2581 is not squashed, your scoped won't show in the docs :(<br></div></div>