The .offsetof property yields a signed int value, an unsigned int like size_t would be more appropriate. Also the exact type yielded by .offsetof should be documented in the Portability Guide of the documentation. The types yielded by .length, .sizeof, and .alignof are specified there. /* dmd -w -O test.d ./test size_t type = uint sizeof type = uint alignof type = uint offsetof type = int */ import std.stdio; struct foo { int bar; } void main() { writefln("size_t type = ", typeid(size_t)); writefln("sizeof type = ", typeid(typeof(foo.bar.sizeof))); writefln("alignof type = ", typeid(typeof(foo.bar.alignof))); writefln("offsetof type = ", typeid(typeof(foo.bar.offsetof))); }
Fixed dmd 1.011
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル