{"id":566,"date":"2011-01-06T20:55:12","date_gmt":"2011-01-06T20:55:12","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=566"},"modified":"2022-02-17T06:24:04","modified_gmt":"2022-02-17T06:24:04","slug":"delegates-general","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/delegates\/delegates-general","title":{"rendered":".Delegates General"},"content":{"rendered":"<p>A delegate is a pointer to a function in managed C++.  Its just like a callback funciton pointer in traditional C++, but more powerful as it deals with the complexity issues and if you want allows you to assign several functions to be called in a single delegate.<\/p>\n<h4>Avoiding Using Delegates<\/h4>\n<p>You can pass objects to other classes \/ objects which they can then store and call functions of that object.  For instance if you want a function to be called by lots of different classes, say to store log events, then simply create it a a class, declare it in the ap&#8217;s main class and pass a handle to it to the constructors of classes \/ objects you want to be able to all it.  It works and is much easier than delegates!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A delegate is a pointer to a function in managed C++. Its just like a callback funciton pointer in traditional C++, but more powerful as it deals with the complexity issues and if you want allows you to assign several functions to be called in a single delegate. Avoiding Using Delegates You can pass objects [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-566","post","type-post","status-publish","format-standard","hentry","category-delegates"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=566"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":1051,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/566\/revisions\/1051"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}