[Issue 15945] sizeof on an invalid type seems to compile.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Apr 24 19:40:58 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15945

Marco Leise <Marco.Leise at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Marco.Leise at gmx.de

--- Comment #1 from Marco Leise <Marco.Leise at gmx.de> ---
You are not indexing T, you are creating a static array of length 0, hence why
it returns 0 for the size. Try T.init[0] instead to use an instance of T.

--


More information about the Digitalmars-d-bugs mailing list