mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-17 13:23:14 +01:00
New array literal support New array ~= operator support (for single element) New with statement support More...
15 lines
245 B
D
15 lines
245 B
D
module arrays4;
|
|
import std.stdio;
|
|
void main()
|
|
{
|
|
int[] arr;
|
|
arr ~= 3;
|
|
assert(arr.length == 1);
|
|
assert(arr[0] == 3);
|
|
arr ~= 5;
|
|
assert(arr.length == 2);
|
|
assert(arr[0] == 3);
|
|
assert(arr[1] == 5);
|
|
writefln(arr);
|
|
}
|