[Issue 938] New: struct with Tuple

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 7 10:29:08 PST 2007


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

           Summary: struct with Tuple
           Product: D
           Version: 1.005
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: Daniel919 at web.de


Hi, dmd crashes on compiling this:
------------------------------------------------------
import std.stdio;

struct Tuple(A...) {
    alias A Tuple;
}

template removeSpace(char[] s, int x = 0) {
    static if (s[0] == ' ')
        alias removeSpace!(s[1..$], x+1) removeSpace;
    else
        alias Tuple!(s, x) removeSpace;
}

void main() {
    alias removeSpace!("       Hello you !") TP;
    writefln(TP.Tuple[0]);
}
------------------------------------------------------


-- 



More information about the Digitalmars-d-bugs mailing list