mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 22:03:14 +01:00
Added initial support for CatExp aka 'a ~ b' Fixed global constant static arrays initialized with string literals Fixed casting any dynamic array to void* Fixed new expression with temporary storage Fixed alias declarations in function scope Fixed relational comparisons of pointers
18 lines
534 B
D
18 lines
534 B
D
module arrays8;
|
|
|
|
void main()
|
|
{
|
|
char[] a = "hello ";
|
|
printf(" \"%s\".length = %u\n", a.ptr, a.length);
|
|
char[] b = "world";
|
|
printf(" \"%s\".length = %u\n", b.ptr, b.length);
|
|
char[] c = a ~ b;
|
|
printf("After 'a ~ b':\n");
|
|
printf(" \"%.*s\".length = %u\n", a.length, a.ptr, a.length);
|
|
printf(" \"%.*s\".length = %u\n", b.length, b.ptr, b.length);
|
|
printf(" \"%.*s\".length = %u\n", c.length, c.ptr, c.length);
|
|
assert(c.length == a.length + b.length);
|
|
assert(c !is a);
|
|
assert(c !is b);
|
|
}
|