Re: Getting .init of a Typetuple

2010-08-20 Thread Johannes Pfau
On 19.08.2010 22:07, Philippe Sigaud wrote: And, looking in my codebase, here is what I'm using ;) template Init(T...) { T Init; } It's so simple... I think I found this before the bug report and then forgot about it and copied an old version. I'll update the bug report

Getting .init of a Typetuple

2010-08-19 Thread Johannes Pfau
Hi, I want to do exactly the same as described in http://d.puremagic.com/issues/show_bug.cgi?id=4536 . The problem is I can't even get the workaround to work. Dmd complains about the following template: --- template Init(T...) { alias

Re: Getting .init of a Typetuple

2010-08-19 Thread Simen kjaeraas
Johannes Pfau s...@example.com wrote: Hi, I want to do exactly the same as described in http://d.puremagic.com/issues/show_bug.cgi?id=4536 . The problem is I can't even get the workaround to work. Dmd complains about the following template:

Re: Getting .init of a Typetuple

2010-08-19 Thread Philippe Sigaud
On Thu, Aug 19, 2010 at 21:51, Simen kjaeraas simen.kja...@gmail.comwrote: Johannes Pfau s...@example.com wrote: Hi, I want to do exactly the same as described in http://d.puremagic.com/issues/show_bug.cgi?id=4536 . The problem is I can't even get the workaround to work. Dmd complains

Re: Getting .init of a Typetuple

2010-08-19 Thread Simen kjaeraas
Philippe Sigaud philippe.sig...@gmail.com wrote: And, looking in my codebase, here is what I'm using ;) template Init(T...) { T Init; } Doh. I believe this is slightly better, though: template Init( T... ) { enum T Init; } :p -- Simen

Re: Getting .init of a Typetuple

2010-08-19 Thread Philippe Sigaud
On Thu, Aug 19, 2010 at 22:16, Simen kjaeraas simen.kja...@gmail.comwrote: Philippe Sigaud philippe.sig...@gmail.com wrote: And, looking in my codebase, here is what I'm using ;) template Init(T...) { T Init; } Doh. I believe this is slightly better, though: template Init( T... )

Re: Getting .init of a Typetuple

2010-08-19 Thread Simen kjaeraas
Philippe Sigaud philippe.sig...@gmail.com wrote: What, that's *five* more characters, five! I win, I win! ;'( More seriously, yours might be more 'solid', but isn't enum implicit in this case? Seems you are right. I thought the template would work as a namespace, giving this situation: