{"id":328,"date":"2014-10-17T22:51:57","date_gmt":"2014-10-17T20:51:57","guid":{"rendered":"https:\/\/blog.ramses-pyramidenbau.de\/?p=328"},"modified":"2015-07-28T00:50:14","modified_gmt":"2015-07-27T22:50:14","slug":"typedef-syntax-with-member-function-pointers","status":"publish","type":"post","link":"https:\/\/blog.vmexit.de\/?p=328","title":{"rendered":"typedef syntax with (member) function pointers"},"content":{"rendered":"<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/05w82thz.aspx\" title=\"MSDN\" target=\"_blank\">MSDN states<\/a>, that the typedef syntax is<\/p>\n<pre class=\"brush: cpp; light: true; title: ; notranslate\" title=\"\">\r\ntypedef type-declaration synonym;\r\n<\/pre>\n<p>But that&#8217;s not the whole truth. If you want to typedef a function pointer or member function pointer, this is wrong:<\/p>\n<pre class=\"brush: cpp; light: true; title: ; notranslate\" title=\"\">\r\ntypedef void(*)(int) myFun;\r\n<\/pre>\n<p>This is the correct syntax:<\/p>\n<pre class=\"brush: cpp; light: true; title: ; notranslate\" title=\"\">\r\ntypedef void(*myFun)(int);\r\ntypedef void(MyClass::*myFun)(int);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MSDN states, that the typedef syntax is typedef type-declaration synonym; But that&#8217;s not the whole truth. If you want to typedef a function pointer or member function pointer, this is wrong: typedef void(*)(int) myFun; This is the correct syntax: typedef void(*myFun)(int); typedef void(MyClass::*myFun)(int);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-328","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328"}],"version-history":[{"count":4,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/posts\/328\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=\/wp\/v2\/posts\/328\/revisions\/363"}],"wp:attachment":[{"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vmexit.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}