{"type":"rich","author_name":"E_Mattsan","version":"1.0","width":"100%","title":"\u4f55\u3067\u3082\u30b3\u30fc\u30eb\u30d0\u30c3\u30af","image_url":null,"blog_title":"\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7684\u611b\u60c5","provider_url":"https://hatena.blog","blog_url":"https://blog.emattsan.org/","url":"https://blog.emattsan.org/entry/20070312/1173706944","categories":["C++"],"description":"boost::function\u3092\u4f7f\u3063\u3066\u306a\u3093\u3067\u3082\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u304d\u308b\u95a2\u6570\u3092\u4f5c\u308b\u3002 void loop(int n, boost::function<void(int)> callback) { for(int i = 0; i < n; ++i) { callback(i); } } void foo(int n); class Bar { public: void operator () (int n); }; void test() { // \u95a2\u6570\u3092\u4e0e\u3048\u308b loop(10, foo); // \u95a2\u6570\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4e0e\u3048\u308b Bar bar; loop(10, bar); // boost::lamb\u2026","author_url":"https://blog.hatena.ne.jp/E_Mattsan/","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.emattsan.org%2Fentry%2F20070312%2F1173706944\" title=\"\u4f55\u3067\u3082\u30b3\u30fc\u30eb\u30d0\u30c3\u30af - \u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u7684\u611b\u60c5\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2007-03-12 22:42:24","height":"190"}