Am Fri, 03 Aug 2012 22:40:02 +0200 schrieb "bearophile" <[email protected]>:
> Another solution (that doesn't replace the need for the > prestate!) is ghost fields, that are class instance/struct fields > usable only inside contracts and that vanish in release mode: > http://d.puremagic.com/issues/show_bug.cgi?id=5027 > > Bye, > bearophile While reading this thread I had the same idea. But the user must be 100% aware, that structs change size in release mode. This can be a real problem for data exchange with libraries using the same struct, in memory mapped files or in files. Just imagine you stored some structured data in a file using the pointer and size of such a struct in release mode. Then you debug the program and you don't realize why the file cannot be loaded any more. If it weren't for the systems programming language part (.sizeof, &...), it could be a nice proposal. -- Marco
