[Issue 533] Cannot use int from tuple as an index

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 27 23:36:53 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=533


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Comment #3 from bugzilla at digitalmars.com  2008-06-28 01:36 -------
The example is broken because in order for the 'promotion' of the member Nth,
it must be the only member. The following works:

import std.stdio;

template Nth(TList...) {
    const int N = TList[0];
    auto Nth = TList[N];
}
void main()
{
    writefln( Nth!(1,"hi","there").Nth );
}


-- 



More information about the Digitalmars-d-bugs mailing list