14.07.2017 19:53, Anton Fediushin пишет:
On Friday, 14 July 2017 at 16:42:59 UTC, drug wrote:
It's because Array(T) is a value type and needs type size to define
itself, so you have expected forward reference. But T[] is reference
type and its size is known in advance - it doesn't depend on
On Friday, 14 July 2017 at 16:42:59 UTC, drug wrote:
It's because Array(T) is a value type and needs type size to
define itself, so you have expected forward reference. But T[]
is reference type and its size is known in advance - it doesn't
depend on type, it's always pointer.sizeof +
14.07.2017 19:12, Anton Fediushin пишет:
This code:
-
import std.container.array;
struct Test {
Array!Test t;
}
-
Fails with an error:
-
/usr/include/dlang/dmd/std/traits.d(2404): Error: struct arrayissue.Test
no size because of forward reference
It's because Array(T) is a
This code:
-
import std.container.array;
struct Test {
Array!Test t;
}
-
Fails with an error:
-
/usr/include/dlang/dmd/std/traits.d(2404): Error: struct
arrayissue.Test no size because of forward reference
/usr/include/dlang/dmd/std/traits.d(3462): Error: template
instance