[dmd-beta] D2 2.058 alpha

Martin Nowak dawg at dawgfoto.de
Wed Feb 8 12:08:50 PST 2012


> But if you put the "static if"-statement after all fields, shouldn't  
> that be enough to have the full size of the struct. Of course it could  
> be hard for the compiler to know that there are no fields after the  
> "static if"-statement. Maybe the compiler could calculate the size  
> incrementally.
>

Static ifs can change the semantics of a type. Now if the static if  
condition itself
depends on that type you have a cycle. Allowing such cycles under certain  
circumstances
could create a lot of confusion.


More information about the dmd-beta mailing list