annotate run/opIndex_03.d @ 480:a3d84fdbfd53

-inline / opIndex / struct Kevin Bealer <Kevin_member@pathlink.com> 2005-04-24 news:d4ha7g$fuc$1@digitaldaemon.com
author thomask
date Mon, 25 Apr 2005 05:43:26 +0000
parents
children 1e6afb94ce6d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
480
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
1 // $HeadURI$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
2 // $Author$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
3 // $Date$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
4
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
5 // @author@ Kevin Bealer <Kevin_member@pathlink.com>
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
6 // @date@ 2005-04-24
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
7 // @uri@ news:d4ha7g$fuc$1@digitaldaemon.com
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
8
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
9 // __DSTRESS_DFLAGS__ -inline
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
10
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
11 module dstress.run.opIndex_03;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
12
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
13 class Range{
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
14 int width(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
15 return 1;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
16 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
17 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
18
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
19 class Container {
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
20 this(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
21 data.length=2;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
22 data[0]=new Range;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
23 data[1]=new Range;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
24 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
25
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
26 Range opIndex(int i){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
27 return data[i];
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
28 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
29
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
30 Range[] data;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
31 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
32
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
33 int main(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
34 Container ranges=new Container;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
35
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
36 if (ranges[0].width == 1){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
37 return 0;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
38 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
39
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
40 assert(0);
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
41 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
42