{"title":"opApply \u306e\u5f15\u6570\u3067\u3042\u308b\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u623b\u308a\u5024","published":"2009-02-27 02:55:46","provider_name":"Hatena Blog","image_url":null,"categories":["DLang"],"version":"1.0","blog_title":"\u30e8\u30fc\u30ad\u30e7\u30af\u30c7\u30a4","url":"https://e10s.hateblo.jp/entry/20090227/1235670946","blog_url":"https://e10s.hateblo.jp/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fe10s.hateblo.jp%2Fentry%2F20090227%2F1235670946\" title=\"opApply \u306e\u5f15\u6570\u3067\u3042\u308b\u30c7\u30ea\u30b2\u30fc\u30c8\u306e\u623b\u308a\u5024 - \u30e8\u30fc\u30ad\u30e7\u30af\u30c7\u30a4\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","author_url":"https://blog.hatena.ne.jp/electrolysis/","provider_url":"https://hatena.blog","author_name":"electrolysis","type":"rich","description":"import std.stdio; class K{ private uint[] a = [3, 1, 4]; int opApply(int delegate(ref uint) dg){ int result; for(uint i; i < a.length; i++){ result = dg(a[i]); writeln(\"r: \", result); if(result){ break; } } return result; } } void test1(K k){ writeln(\"test1 : normal\"); foreach(e; k){ } } void test2(\u2026","width":"100%"}