{"id":32586,"date":"2023-07-13T16:41:05","date_gmt":"2023-07-13T16:41:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=32586"},"modified":"2023-07-17T15:41:26","modified_gmt":"2023-07-17T15:41:26","slug":"visualize-macro-expansion-for-c","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/visualize-macro-expansion-for-c\/","title":{"rendered":"Visualize Macro Expansion for C++"},"content":{"rendered":"<p>We are excited to announce the availability of Visualize Macro Expansion in Visual Studio 17.7 Preview. This feature lets you visualize the step-by-step expansion of macros.\u00a0To begin utilizing this feature, ensure that you update to the latest version of Visual Studio Preview.<\/p>\n<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\">Download Visual Studio Preview\u202f <\/a><\/div><\/p>\n<h3>Visualize Macro Expansion<\/h3>\n<p>Visual Studio has introduced an enhanced Macro Expansion feature. This feature brings significant benefits, enabling you to comprehend and review complex multi-level macro expansions in a step-by-step manner. When you hover over a macro, you can access Quick Info, which now includes the Visualize Expansion link in addition to the Copy and Expand Inline options. The Visual Expansion will enable you to visualize the preprocessor passes of the expansion.<\/p>\n<p><figure id=\"attachment_32589\" aria-labelledby=\"figcaption_attachment_32589\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link.png\"><img decoding=\"async\" class=\"size-full wp-image-32589\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link.png\" alt=\"Image of Visualize Expansion.\" width=\"1379\" height=\"599\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link.png 1379w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link-300x130.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link-1024x445.png 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/Visualize_Expansion_Link-768x334.png 768w\" sizes=\"(max-width: 1379px) 100vw, 1379px\" \/><\/a><figcaption id=\"figcaption_attachment_32589\" class=\"wp-caption-text\">Image of Visualize Expansion.<\/figcaption><\/figure><\/p>\n<p>The Visual Expansion link opens a new window that initially displays the first step of macro expansion. By utilizing the arrows next to the expansion step numbers, you can easily navigate through the subsequent steps of the expansion. This feature proves especially valuable in scenarios involving nested macros with lengthy expansions. In cases where nested macros have long expansions, this feature will help to precisely identify the actions taking place at each step, facilitating a deeper understanding of the macro&#8217;s behavior. <\/span><span class=\"NormalTextRun SCXW234140103 BCX8\" data-ccp-charstyle=\"normaltextrun\">Ultimately, this<\/span><span class=\"NormalTextRun SCXW234140103 BCX8\" data-ccp-charstyle=\"normaltextrun\"> feature <\/span><span class=\"NormalTextRun SCXW234140103 BCX8\" data-ccp-charstyle=\"normaltextrun\">greatly enhances<\/span><span class=\"NormalTextRun SCXW234140103 BCX8\" data-ccp-charstyle=\"normaltextrun\"> the efficiency of your debugging efforts, enabling you to pinpoint and resolve issues more effectively.\u202f<\/span><\/span><span class=\"TextRun SCXW234140103 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW234140103 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;2d7dabfc-e829-4638-80ba-daf00f88ebc6|36&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW234140103 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><figure id=\"attachment_32587\" aria-labelledby=\"figcaption_attachment_32587\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/visualize_macro_expansion_V2.gif\"><img decoding=\"async\" class=\"size-full wp-image-32587\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/07\/visualize_macro_expansion_V2.gif\" alt=\"\u202fGif for visualizing macro expansion process.\u202f\" width=\"2208\" height=\"1146\" \/><\/a><figcaption id=\"figcaption_attachment_32587\" class=\"wp-caption-text\">Gif for visualizing macro expansion process.<\/figcaption><\/figure><\/p>\n<h3><span class=\"TextRun SCXW14679085 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW14679085 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;2d7dabfc-e829-4638-80ba-daf00f88ebc6|35&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Send us your feedback!<\/span><\/span><\/h3>\n<p><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;2d7dabfc-e829-4638-80ba-daf00f88ebc6|35&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;normaltextrun&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;normaltextrun&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">Download<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">\u00a0the <\/span><\/span><a class=\"Hyperlink SCXW63791614 BCX8\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"Hyperlink\">latest version of Visual Studio Preview<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"Hyperlink\">,<\/span><\/span><\/a><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"> <span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">and <\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">try out<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\"> Visualize Macro Expansion<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">.\u00a0<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">We would love to hear your thoughts, so please share your feedback<\/span><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">\u00a0in the comments below, on <\/span><\/span><a class=\"Hyperlink SCXW63791614 BCX8\" href=\"https:\/\/developercommunity.visualstudio.com\/cpp\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"Hyperlink\">Developer Community<\/span><\/span><\/a><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">, or reach out to us on Twitter\u202f(<\/span><\/span><a class=\"Hyperlink SCXW63791614 BCX8\" href=\"https:\/\/twitter.com\/visualc\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"Hyperlink\">@VisualC<\/span><\/span><\/a><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">) or via email at <\/span><\/span><a class=\"Hyperlink SCXW63791614 BCX8\" href=\"mailto:visualcpp@microsoft.com\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"Hyperlink\">visualcpp@microsoft.com<\/span><\/span><\/a><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"normaltextrun\">. Your input is highly appreciated!<\/span><\/span><span class=\"TextRun SCXW63791614 BCX8\" lang=\"EN-029\" xml:lang=\"EN-029\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW63791614 BCX8\" data-ccp-charstyle=\"eop\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;2d7dabfc-e829-4638-80ba-daf00f88ebc6|36&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;eop&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;eop&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">\u202f<\/span><\/span><span class=\"EOP SCXW63791614 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the availability of Visualize Macro Expansion in Visual Studio 17.7 Preview. This feature lets you visualize the step-by-step expansion of macros.\u00a0To begin utilizing this feature, ensure that you update to the latest version of Visual Studio Preview. Visualize Macro Expansion Visual Studio has introduced an enhanced Macro Expansion feature. This [&hellip;]<\/p>\n","protected":false},"author":96741,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,3927],"tags":[],"class_list":["post-32586","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-game-development"],"acf":[],"blog_post_summary":"<p>We are excited to announce the availability of Visualize Macro Expansion in Visual Studio 17.7 Preview. This feature lets you visualize the step-by-step expansion of macros.\u00a0To begin utilizing this feature, ensure that you update to the latest version of Visual Studio Preview. Visualize Macro Expansion Visual Studio has introduced an enhanced Macro Expansion feature. This [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/96741"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=32586"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32586\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=32586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=32586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=32586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}