reduce に cannot modify ... with immutable members って怒られる 登録日は 12/22 ですが、22 == 0x16 なので 12/16 の記事ということにしましょう。 これがコンパイル通らない。 struct M { immutable int value; } auto f(M[] xs) { import std.algorithm : reduce; ret

kasumanikasumani のブックマーク 2013/12/25 19:00

その他

このブックマークにはスターがありません。
最初のスターをつけてみよう!

reduce に cannot modify ... with immutable members って怒られる - Qiita

    struct M { immutable int value; } auto f(M[] xs) { import std.algorithm : reduce; return xs.reduce!((x, y) => M(x.value + y.value)); } phobos\std\algorithm.d(763): Error: cannot modify struct resul...

    \ コメントが サクサク読める アプリです /

    • App Storeからダウンロード
    • Google Playで手に入れよう