Ok, I think I understand where you're coming from. The intended use for this was to add member functions depending on the result of the static if, not member variables. Adding member functions should in theory be legal, but figuring out whether an instantiation could add member functions is non-trivial and I think equivalent to the Halting Problem.<br>
<br><div class="gmail_quote">On Wed, Feb 8, 2012 at 9:59 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">
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>
<div class="HOEnZb"><div class="h5"><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 array<br>
>> issue. But I want to see if there are any others before we do a 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>
</div></div></blockquote></div><br>