comparison test/d.d @ 1:c53b6e3fe49a trunk

[svn r5] Initial commit. Most things are very rough.
author lindquist
date Sat, 01 Sep 2007 21:43:27 +0200
parents
children b706170e24a9
comparison
equal deleted inserted replaced
0:a9e71648e74d 1:c53b6e3fe49a
1 module d;
2 /*
3 void main()
4 {
5 int delegate() dg;
6 int i = dg();
7
8 struct S
9 {
10 int i;
11 long l;
12 float f;
13
14 int func()
15 {
16 return 42;
17 }
18 }
19
20 S s;
21 auto dg2 = &s.func;
22 i = dg2();
23
24 i = f(dg2, 1);
25 }
26
27 int f(int delegate() dg, int i)
28 {
29 return dg() + i;
30 }
31 */
32
33 struct S
34 {
35 int i;
36 float f;
37 int square()
38 {
39 return i*i;
40 }
41 }
42
43 S s;
44
45 void main()
46 {
47 auto dg = &s.square;
48 }