{"id":441,"date":"2010-12-21T20:35:18","date_gmt":"2010-12-21T20:35:18","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=441"},"modified":"2022-02-17T06:24:04","modified_gmt":"2022-02-17T06:24:04","slug":"typeof","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/typeof\/typeof","title":{"rendered":"typeof"},"content":{"rendered":"<p>\nNot used&nbsp;in VC++\n<\/p>\n<p>\nFor managed code use typeid instead:\n<\/p>\n<pre>\r\n<code>\r\nMyClassName::typeid\r\n<\/code><\/pre>\n<p>\n<em>N.B. typeid isn&#39;t shown as an as you type option after ::&nbsp;but when fully typed it becomes blue to confirm the special keyword.<\/em>\n<\/p>\n<p>\nIf using&nbsp;\/clr:oldSyntax command line option you can use __typeof instead:\n<\/p>\n<pre>\r\n<code>\r\n__typeof(MyClassName)\r\n<\/code><\/pre>\n<h4>\nExamples<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nXmlSerializer ^XmlSerializer1 = gcnew XmlSerializer(MyClassName::typeid);\r\n<\/code><\/pre>\n<p>\n&nbsp;\n<\/p>\n<p>\nAn example creating a type object:\n<\/p>\n<pre>\r\n<code>\r\n\tType^ attributeType = AssemblyFileVersionAttribute::typeid;\r\n<\/code><\/pre>\n<p>\nYou can then use attributeType in place of typeof(###)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not used&nbsp;in VC++ For managed code use typeid instead: MyClassName::typeid N.B. typeid isn&#39;t shown as an as you type option after ::&nbsp;but when fully typed it becomes blue to confirm the special keyword. If using&nbsp;\/clr:oldSyntax command line option you can use __typeof instead: __typeof(MyClassName) Examples XmlSerializer ^XmlSerializer1 = gcnew XmlSerializer(MyClassName::typeid); &nbsp; An example creating a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[],"class_list":["post-441","post","type-post","status-publish","format-standard","hentry","category-typeof"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/441","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=441"}],"version-history":[{"count":6,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/441\/revisions"}],"predecessor-version":[{"id":977,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/441\/revisions\/977"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}