www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 938] New: struct with Tuple

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: Daniel919 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]);
}
------------------------------------------------------


-- 
Feb 07 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=938


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         OS/Version|Windows                     |All
         Resolution|                            |FIXED





Fixed in DMD-1.009

Added to DStress as
http://dstress.kuehne.cn/compile/t/tuple_21_A.d
http://dstress.kuehne.cn/compile/t/tuple_21_B.d


-- 
Apr 06 2007