{"id":843,"date":"2015-11-17T23:32:31","date_gmt":"2015-11-17T14:32:31","guid":{"rendered":"http:\/\/dev.activebasic.com\/egtra\/?p=843"},"modified":"2015-11-17T23:32:31","modified_gmt":"2015-11-17T14:32:31","slug":"vc-2015%e3%81%aebind%e3%81%a8mem_fn%e3%81%af%e5%91%bc%e5%87%ba%e8%a6%8f%e7%b4%84%e4%bb%98%e3%81%8d%e3%81%ae%e9%96%a2%e6%95%b0%e3%82%92%e6%89%b1%e3%81%88%e3%82%8b","status":"publish","type":"post","link":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/","title":{"rendered":"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b"},"content":{"rendered":"<p>Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u4ee5\u5916\u306e\u547c\u51fa\u898f\u7d04\u306e\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre lang=\"cpp\">\r\n#include <iostream>\r\n#include <functional>\r\n\r\nvoid __stdcall fs(int i)\r\n{\r\n  std::cout << i << std::endl;\r\n}\r\n\r\nvoid __fastcall ff(const char* s)\r\n{\r\n  std::cout << s << std::endl;\r\n}\r\n\r\nint main()\r\n{\r\n  auto x = std::bind(fs, 1);\r\n  auto y = std::bind(ff, \"mikan\");\r\n  x();\r\n  y();\r\n}\r\n<\/pre>\n<p>C++\/CLI\u3068\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u5834\u5408\u3001__fastcall\u306e\u4ee3\u308f\u308a\u306b__clrcall\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>mem_fn\u306e\u4f8b\u3067\u3059\u3002\u30e1\u30f3\u30d0\u95a2\u6570\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306f__thiscall\u306a\u306e\u3067\u3001\u65b0\u305f\u306b__cdecl\u3084__stdcall\u306e\u95a2\u6570\u3092\u6e21\u305b\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre lang=\"cpp\">\r\nclass hoge\r\n{\r\npublic:\r\n  void __cdecl f() {}\r\n};\r\n\r\nint main()\r\n{\r\n  std::mem_fn(&hoge::f);\r\n}\r\n<\/pre>\n<p>__stdcall\u306e\u30e1\u30f3\u30d0\u95a2\u6570\u306e\u4f8b\u3067\u3059\u3002\u79c1\u81ea\u8eab\u3001COM\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u95a2\u6570\u3092bind\u3084mem_fn\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre lang=\"cpp\">\r\n#include <functional>\r\n#include <memory>\r\n#include <shlwapi.h>\r\n\r\nint main()\r\n{\r\n  std::shared_ptr<IStream> p(\r\n    SHCreateMemStream(nullptr, 0),\r\n    std::mem_fn(&IUnknown::Release));\r\n}\r\n<\/pre>\n<p>\u306a\u304a\u3001Boost\u306ebind\u3068mem_fn\u3067\u306f\u3001\u4ee5\u524d\u3088\u308a\u7279\u5b9a\u306e#define\u5b9a\u7fa9\u3067\u3001\u547c\u3073\u51fa\u3057\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<a href=\"https:\/\/www.boost.org\/doc\/libs\/1_59_0\/libs\/bind\/doc\/html\/bind.html#bind.implementation.stdcall\">__stdcall, __cdecl, __fastcall, and pascal Support<\/a><\/p>\n<ul>\n<li>BOOST_BIND_ENABLE_STDCALL, BOOST_MEM_FN_ENABLE_STDCALL<\/li>\n<li>BOOST_BIND_ENABLE_FASTCALL, BOOST_MEM_FN_ENABLE_STDCALL<\/li>\n<li>BOOST_BIND_ENABLE_STDCALL, BOOST_MEM_FN_ENABLE_FASTCALL<\/li>\n<li>BOOST_BIND_ENABLE_PASCAL<\/li>\n<li>BOOST_MEM_FN_ENABLE_CDECL<\/li>\n<\/ul>\n<p>Visual C++ 2015\u306e\u307b\u3046\u306f\u3001\u3068\u304f\u306b\u4f55\u3082\u5b9a\u7fa9\u3057\u306a\u304f\u3066\u3082\u5404\u7a2e\u547c\u51fa\u898f\u7d04\u306e\u95a2\u6570\u3092\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u306eVisual C++\u306fpascal\u547c\u51fa\u898f\u7d04\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001Visual C++\u306estd::bind\u3068std::mem_fn\u306fx86\uff0832\u30d3\u30c3\u30c8\uff09\u306eVisual C++\u3067\u4f7f\u3048\u308b\u547c\u51fa\u898f\u7d04\u4e00\u901a\u308a\u306b\u5bfe\u5fdc\u3057\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3001Visual C++ 2015\u306estd::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u305f\u8a71\u3067\u3057\u305f\u3002\u306a\u304a\u3001\u79c1\u3001\u904e\u53bb\u3053\u308c\u304c\u7406\u7531\u3067boost::bind\u3084boost::mem_fn\u3092\u4f7f\u3063\u305f\u5834\u9762\u304c\u5b9f\u969b\u3042\u308a\u307e\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306e\u5bfe\u5fdc\u3067\u5927\u5909\u4fbf\u5229\u306b\u306a\u3063\u305f\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,12],"tags":[171,50],"class_list":["post-843","post","type-post","status-publish","format-standard","hentry","category-cpp","category-vc","tag-bind","tag-cplusplus11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d<\/title>\n<meta name=\"description\" content=\"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"og:description\" content=\"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/\" \/>\n<meta property=\"og:site_name\" content=\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ysk.noh\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-17T14:32:31+00:00\" \/>\n<meta name=\"author\" content=\"egtra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@egtra\" \/>\n<meta name=\"twitter:site\" content=\"@egtra\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"egtra\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/\",\"name\":\"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"isPartOf\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\"},\"datePublished\":\"2015-11-17T14:32:31+00:00\",\"dateModified\":\"2015-11-17T14:32:31+00:00\",\"author\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\"},\"description\":\"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/dev.activebasic.com\/egtra\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/\",\"name\":\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"description\":\"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\",\"name\":\"egtra\",\"sameAs\":[\"https:\/\/x.com\/egtra\"],\"url\":\"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/","og_locale":"ja_JP","og_type":"article","og_title":"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","og_description":"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002","og_url":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/","og_site_name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","article_publisher":"https:\/\/www.facebook.com\/ysk.noh","article_published_time":"2015-11-17T14:32:31+00:00","author":"egtra","twitter_card":"summary_large_image","twitter_creator":"@egtra","twitter_site":"@egtra","twitter_misc":{"\u57f7\u7b46\u8005":"egtra"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/","url":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/","name":"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","isPartOf":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#website"},"datePublished":"2015-11-17T14:32:31+00:00","dateModified":"2015-11-17T14:32:31+00:00","author":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164"},"description":"Visual C++ 2015\u304b\u3089\u3001std::bind\u3068std::mem_fn\u304c__stdcall, __fastcall, __clrcall\u306e\u95a2\u6570\u30fb\u30e1\u30f3\u30d0\u95a2\u6570\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f\u3002\u4f55\u500b\u304b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u8a66\u3057\u3066\u3044\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dev.activebasic.com\/egtra\/2015\/11\/17\/843\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/dev.activebasic.com\/egtra\/"},{"@type":"ListItem","position":2,"name":"VC++ 2015\u306ebind\u3068mem_fn\u306f\u547c\u51fa\u898f\u7d04\u4ed8\u304d\u306e\u95a2\u6570\u3092\u6271\u3048\u308b"}]},{"@type":"WebSite","@id":"https:\/\/dev.activebasic.com\/egtra\/#website","url":"https:\/\/dev.activebasic.com\/egtra\/","name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164","name":"egtra","sameAs":["https:\/\/x.com\/egtra"],"url":"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/843"}],"collection":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/comments?post=843"}],"version-history":[{"count":0,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/843\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/media?parent=843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/categories?post=843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/tags?post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}