854
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Chris Miller <chris@dprogramming.com>
|
|
6 // @date@ 2006-02-16
|
1489
|
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6288
|
854
|
8
|
|
9 module dstress.run.c.continue_04_A;
|
|
10
|
|
11 struct MyStruct{
|
1535
|
12 int opApply(int delegate(ref int i) dg){
|
854
|
13 for(int index=0; index < 3; index++){
|
|
14 dg(index);
|
|
15 }
|
|
16 return 0;
|
|
17 }
|
|
18 }
|
|
19
|
|
20 int main(){
|
|
21 MyStruct foo;
|
|
22 int sum;
|
1090
|
23
|
854
|
24 foreach(int i; foo){
|
|
25 sum += i;
|
|
26 }
|
|
27
|
|
28 if(sum == 3){
|
|
29 return 0;
|
|
30 }
|
|
31 }
|
|
32
|