annotate compile/t/tuple_21_A.d @ 1484:5100b74e1aa3

[Issue 938] struct with Tuple Daniel <Daniel919@web.de> 2007-02-07 http://d.puremagic.com/issues/show_bug.cgi?id=938
author thomask
date Fri, 06 Apr 2007 11:28:23 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1484
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
1 // $HeadURL$
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
2 // $Date$
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
3 // $Author$
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
4
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
5 // @author@ Daniel <Daniel919@web.de>
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
6 // @date@ 2007-02-07
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=938
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
8 // @desc@ [Issue 938] struct with Tuple
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
9
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
10 module dstress.compile.t.tuple_21_A;
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
11
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
12 struct Tuple(A...) {
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
13 alias A Tuple;
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
14 }
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
15
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
16 template removeSpace(char[] s, int x = 0) {
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
17 static if (s[0] == ' '){
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
18 alias removeSpace!(s[1..$], x+1) removeSpace;
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
19 }else{
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
20 alias Tuple!(s, x) removeSpace;
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
21 }
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
22 }
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
23
5100b74e1aa3 [Issue 938] struct with Tuple
thomask
parents:
diff changeset
24 static assert("Hello you !" == removeSpace!(" Hello you !").Tuple[0]);