mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-06 23:44:09 +02:00
[svn r5] Initial commit. Most things are very rough.
This commit is contained in:
48
test/d.d
Normal file
48
test/d.d
Normal file
@@ -0,0 +1,48 @@
|
||||
module d;
|
||||
/*
|
||||
void main()
|
||||
{
|
||||
int delegate() dg;
|
||||
int i = dg();
|
||||
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
long l;
|
||||
float f;
|
||||
|
||||
int func()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
S s;
|
||||
auto dg2 = &s.func;
|
||||
i = dg2();
|
||||
|
||||
i = f(dg2, 1);
|
||||
}
|
||||
|
||||
int f(int delegate() dg, int i)
|
||||
{
|
||||
return dg() + i;
|
||||
}
|
||||
*/
|
||||
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
float f;
|
||||
int square()
|
||||
{
|
||||
return i*i;
|
||||
}
|
||||
}
|
||||
|
||||
S s;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto dg = &s.square;
|
||||
}
|
||||
Reference in New Issue
Block a user