mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 23:03:14 +01:00
New array literal support New array ~= operator support (for single element) New with statement support More...
20 lines
275 B
D
20 lines
275 B
D
module arrays7;
|
|
|
|
struct S
|
|
{
|
|
int i;
|
|
float f;
|
|
long l;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
S[] arr;
|
|
S s;
|
|
arr ~= s;
|
|
arr ~= S(1,2.64,0xFFFF_FFFF_FFFF);
|
|
assert(arr[1].i == 1);
|
|
assert(arr[1].f > 2.63 && arr[1].f < 2.65);
|
|
assert(arr[1].l == 0xFFFF_FFFF_FFFF);
|
|
}
|