{"published":"2020-11-09 00:00:00","author_url":"https://blog.hatena.ne.jp/yohhoy/","description":"C++17\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5c0e\u5165\u3055\u308c\u305fstd::function\u30af\u30e9\u30b9\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u63a8\u8ad6\u30ac\u30a4\u30c9(deduction guide)\u306b\u3064\u3044\u3066\u30e1\u30e2\u3002 #include <functional> // \u95a2\u6570\u30dd\u30a4\u30f3\u30bf\u304b\u3089\u63a8\u8ad6 int f(int n) { return n; } std::function f1 = f; // OK: function<int(int)> // \u30e9\u30e0\u30c0\u5f0f\u304b\u3089\u63a8\u8ad6 std::function f2 = [](int n){ return n; }; // OK: function<int(int)> // \u30d5\u30a1\u30f3\u30af\u30bf\u304b\u3089\u63a8\u8ad6 struct Functor { int m_;\u2026","categories":["C++"],"url":"https://yohhoy.hatenadiary.jp/entry/20201109/p1","height":"190","title":"std::function\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u63a8\u8ad6\u30ac\u30a4\u30c9","blog_title":"yohhoy\u306e\u65e5\u8a18","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20201109%2Fp1\" title=\"std::function\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u63a8\u8ad6\u30ac\u30a4\u30c9 - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","type":"rich","width":"100%","version":"1.0","provider_name":"Hatena Blog","blog_url":"https://yohhoy.hatenadiary.jp/","provider_url":"https://hatena.blog","author_name":"yohhoy","image_url":null}