Seems as though struct arrays aren't default initialised inside CTFE. CTFE disallows concatenation to an unitialised struct array, also can't get the length. Workaround is easy - just initialise the array to []. ----------- struct S { int a; } int func() { /* This is OK int [] q; q ~=4; */ S [] s; // makes the next lines fail. (but S[] s = []; compiles). s ~= S(7); // fails return s.length; // this fails too } void main() { const int x = func(); }
Fixed dmd 1.021 and 2.004
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル