annotate run/c/continue_04_A.d @ 1535:20d8ee6523e1

updated to DMD-1.013
author thomask
date Mon, 07 May 2007 05:19:57 +0000
parents b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
854
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
1 // $HeadURL$
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
2 // $Date$
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
3 // $Author$
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
4
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
5 // @author@ Chris Miller <chris@dprogramming.com>
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
6 // @date@ 2006-02-16
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1090
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=6288
854
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
8
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
9 module dstress.run.c.continue_04_A;
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
10
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
11 struct MyStruct{
1535
20d8ee6523e1 updated to DMD-1.013
thomask
parents: 1489
diff changeset
12 int opApply(int delegate(ref int i) dg){
854
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
13 for(int index=0; index < 3; index++){
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
14 dg(index);
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
15 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
16 return 0;
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
17 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
18 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
19
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
20 int main(){
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
21 MyStruct foo;
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
22 int sum;
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 854
diff changeset
23
854
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
24 foreach(int i; foo){
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
25 sum += i;
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
26 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
27
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
28 if(sum == 3){
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
29 return 0;
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
30 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
31 }
b450f8aa4d3c Chris Miller <chris@dprogramming.com>
thomask
parents:
diff changeset
32