Mercurial > projects > dstress
annotate nocompile/template_05.d @ 85:659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
2) added several bug reports
3) fixed some test cases
author | thomask |
---|---|
date | Sun, 31 Oct 2004 21:21:04 +0000 |
parents | |
children | 24da167d3f07 |
rev | line source |
---|---|
85
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
1 // @author@ =?iso-8859-1?q?Knud_S=F8rensen?= <knud@NetRunner.all-technology.com> |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
2 // @date@ 2004-05-30 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
3 // @uri@ news://pan.2004.05.30.19.54.44.280109@NetRunner.all-technology.com |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
4 // @url@ nttp://digitalmars.com/digitalmars.D.bugs:329 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
5 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
6 module dstress.nocompile.template_05; |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
7 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
8 template pow(x, int n){ |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
9 static assert(n>=0); |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
10 enum { |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
11 pow = pow!(x,n % 2) * pow!(x*x,n/2) |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
12 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
13 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
14 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
15 template pow(x,int n:1) { |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
16 enum{ |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
17 pow= x |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
18 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
19 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
20 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
21 template pow(x,int n:0) { |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
22 enum { |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
23 pow= 1 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
24 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
25 } |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
26 |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
27 int main(){ |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
28 pow!(3,4); |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
29 return 0; |
659bb018c489
1) changed "?DSTRESS_FLAGS?" to "__DSTRESS_DFLAGS__" in order to cope with botched shells
thomask
parents:
diff
changeset
|
30 } |