Yeah. Now that you point this out, I agree 100%. Feel free to close the relevant bug report as invalid.<br><br><div class="gmail_quote">On Wed, Feb 8, 2012 at 11:06 AM, Don Clugston <span dir="ltr"><<a href="mailto:dclugston@googlemail.com">dclugston@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 8 February 2012 16:31, David Simcha <<a href="mailto:dsimcha@gmail.com">dsimcha@gmail.com</a>> wrote:<br>
> Ok, I think I understand where you're coming from. The intended use for<br>
> this was to add member functions depending on the result of the static if,<br>
> not member variables. Adding member functions should in theory be legal,<br>
> but figuring out whether an instantiation could add member functions is<br>
> non-trivial and I think equivalent to the Halting Problem.<br>
<br>
</div>I mean X.tupleof shouldn't be defined, if X is not fully defined yet.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Wed, Feb 8, 2012 at 9:59 AM, Don Clugston <<a href="mailto:dclugston@googlemail.com">dclugston@googlemail.com</a>><br>
> wrote:<br>
>><br>
>> I don't think that should compile. If there was anything inside the<br>
>> 'static if' body, it'd be wrong code.<br>
>> To me, that looks like an accepts-invalid bug that's been fixed.<br>
>><br>
>> On 8 February 2012 14:56, David Simcha <<a href="mailto:dsimcha@gmail.com">dsimcha@gmail.com</a>> wrote:<br>
>> > On 2/8/2012 5:50 AM, Walter Bright wrote:<br>
>> >><br>
>> >> <a href="http://ftp.digitalmars.com/dmd2beta.zip" target="_blank">http://ftp.digitalmars.com/dmd2beta.zip</a><br>
>> >><br>
>> >> I'm calling it an alpha because we haven't resolved the associative<br>
>> >> array<br>
>> >> issue. But I want to see if there are any others before we do a<br>
>> >> release.<br>
>> >> _______________________________________________<br>
>> >> dmd-beta mailing list<br>
>> >> <a href="mailto:dmd-beta@puremagic.com">dmd-beta@puremagic.com</a><br>
>> >> <a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
>> >><br>
>> ><br>
>> > Bug 7426 is still broken in cases that worked in 2.057.<br>
>> ><br>
>> > struct S {<br>
>> > static if(hasIndirections!(typeof(this))) {}<br>
>> > }<br>
>> ><br>
>> > template hasIndirections(T)<br>
>> > {<br>
>> > enum hasIndirections = hasIndirectionsImpl!(typeof(T.init.tupleof));<br>
>> > }<br>
>> ><br>
>> > template hasIndirectionsImpl(T...)<br>
>> > {<br>
>> > static if (!T.length)<br>
>> > {<br>
>> > enum hasIndirectionsImpl = false;<br>
>> > }<br>
>> > else<br>
>> > {<br>
>> > enum hasIndirectionsImpl = true;<br>
>> ><br>
>> > }<br>
>> > }<br>
>> ><br>
>> > _______________________________________________<br>
>> > dmd-beta mailing list<br>
>> > <a href="mailto:dmd-beta@puremagic.com">dmd-beta@puremagic.com</a><br>
>> > <a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
>> _______________________________________________<br>
>> dmd-beta mailing list<br>
>> <a href="mailto:dmd-beta@puremagic.com">dmd-beta@puremagic.com</a><br>
>> <a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> dmd-beta mailing list<br>
> <a href="mailto:dmd-beta@puremagic.com">dmd-beta@puremagic.com</a><br>
> <a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
_______________________________________________<br>
dmd-beta mailing list<br>
<a href="mailto:dmd-beta@puremagic.com">dmd-beta@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-beta" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-beta</a><br>
</div></div></blockquote></div><br>