Mercurial > projects > dstress
annotate run/overload_02.d @ 1:3414705c41ac
removed CVS header
author | thomask |
---|---|
date | Sun, 26 Sep 2004 12:06:09 +0000 |
parents | 3269e4627918 |
children | f87ba6507260 |
rev | line source |
---|---|
0 | 1 |
2 int status; | |
3 | |
4 struct MyStruct{ | |
5 void check( byte b){ | |
6 status+=b; | |
7 } | |
8 void check( short s ){ | |
9 status-=s; | |
10 } | |
11 void check( int i ){ | |
12 status+= i*2; | |
13 } | |
14 } | |
15 | |
16 int main(){ | |
17 MyStruct S; | |
18 | |
19 byte b = 2; | |
20 short s = 3; | |
21 int i = 4; | |
22 | |
23 assert(status == 0); | |
24 S.check(b); | |
25 assert(status == 2); | |
26 S.check(s); | |
27 assert(status == -1); | |
28 S.check(i); | |
29 assert(status == 7 ); | |
30 return 0; | |
31 } | |
32 |