Getting .init of a Typetuple

Philippe Sigaud philippe.sigaud at gmail.com
Thu Aug 19 13:31:10 PDT 2010


On Thu, Aug 19, 2010 at 22:16, Simen kjaeraas <simen.kjaras at gmail.com>wrote:

> Philippe Sigaud <philippe.sigaud at 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
>

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?

Anyway, T.init should exist, since "T Init;" works...

Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100819/ca0b4163/attachment.html>


More information about the Digitalmars-d-learn mailing list