{"id":31987,"date":"2023-03-28T19:03:34","date_gmt":"2023-03-28T19:03:34","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=31987"},"modified":"2023-07-13T22:05:50","modified_gmt":"2023-07-13T22:05:50","slug":"create-c-member-function-in-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/create-c-member-function-in-visual-studio\/","title":{"rendered":"Create C++ Member Function in Visual Studio"},"content":{"rendered":"<p><span class=\"TextRun SCXW27194093 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW27194093 BCX8\">We are excited to announce that <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">Create <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">C++ <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">Member Function <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">can now be used<\/span><span class=\"NormalTextRun SCXW27194093 BCX8\"> to quickly add constructor and <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW27194093 BCX8\">equality operator<\/span> <span class=\"NormalTextRun CommentHighlightPipeRest SCXW27194093 BCX8\">(operator ==)<\/span><span class=\"NormalTextRun SCXW27194093 BCX8\"> in <\/span><\/span><a class=\"Hyperlink SCXW27194093 BCX8\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW27194093 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW27194093 BCX8\" data-ccp-charstyle=\"Hyperlink\">Visual Studio 17.6 Preview 2<\/span><\/span><\/a><span class=\"TextRun SCXW27194093 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW27194093 BCX8\">.<\/span> <span class=\"NormalTextRun SCXW27194093 BCX8\">When you have <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">a <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">class with fields, <\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">you can<\/span><span class=\"NormalTextRun SCXW27194093 BCX8\"> add a default constructor, constructor with all fields, equality operator, and <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW27194093 BCX8\">equality <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW27194093 BCX8\">operator<\/span><span class=\"NormalTextRun CommentHighlightPipeRest CommentHighlightRest SCXW27194093 BCX8\"> with all fields<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW27194093 BCX8\"> easily<\/span><span class=\"NormalTextRun SCXW27194093 BCX8\">.<\/span><\/span><\/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 2022 17.6 Preview 2<\/a><\/div><\/p>\n<p><span class=\"TextRun SCXW262668772 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW262668772 BCX8\">Three<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> dots will appear below <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">a<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> class name<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> to <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">indicate<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> that you can add <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">a <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">member function<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">, and you can ho<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">ver over them to <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">see the quick action<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> (screwdriver icon)<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">.<\/span> <span class=\"NormalTextRun SCXW262668772 BCX8\">When<\/span> <span class=\"NormalTextRun SCXW262668772 BCX8\">the <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">default <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">constructor and equality operator <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">are <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">added<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> respectively<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">, <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">the <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">Go<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> to Def<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">initio<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">n<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\"> of the <\/span><\/span><code class=\"language-cpp\">operator==<\/code> <span class=\"TextRun SCXW262668772 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW262668772 BCX8\">is displayed <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">below<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\">, showing that the<\/span><span class=\"NormalTextRun SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;3c779956-b350-4caa-9268-10c2346b7b23|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;ui-provider&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;ui-provider&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\"> body of <\/span><span class=\"NormalTextRun SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\">the<\/span> <span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\">equality <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\">operator would have nothing<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\"> inside it<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW262668772 BCX8\" data-ccp-charstyle=\"ui-provider\">.<\/span><\/span><span class=\"EOP SCXW262668772 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/03\/cpp-create-memeber-function-NoFieldExample.gif\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-31990\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/03\/cpp-create-memeber-function-NoFieldExample.gif\" alt=\"An example of creating C++ member function without fields.\" width=\"1410\" height=\"891\" \/><\/a><\/p>\n<p><span class=\"TextRun SCXW133489767 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\" data-ccp-charstyle-defn=\"{&quot;ObjectId&quot;:&quot;3c779956-b350-4caa-9268-10c2346b7b23|12&quot;,&quot;ClassId&quot;:1073872969,&quot;Properties&quot;:[469775450,&quot;ui-provider&quot;,201340122,&quot;1&quot;,134233614,&quot;true&quot;,469778129,&quot;ui-provider&quot;,335572020,&quot;1&quot;,469778324,&quot;Default Paragraph Font&quot;]}\">You can <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">also choose<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\"> to add <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">a<\/span> <span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">constructor with all fields and <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">an <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">equality operator with all fields<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\"> respectively<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">, <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">and <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">the Go to Def<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">inition<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\"> will <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">show that <\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">the <\/span><\/span><code class=\"language-cpp\">operator==<\/code><span class=\"TextRun SCXW133489767 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\">\u00a0<span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">has<\/span> <span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">all<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\"> the field comparisons<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">.<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">\u00a0<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">\u00a0<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\" data-ccp-charstyle=\"ui-provider\">\u00a0<\/span><span class=\"NormalTextRun SCXW133489767 BCX8\">\u00a0<\/span><\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-31991\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/03\/cpp-create-memeber-function-WithFieldsExample.gif\" alt=\"An example of creating C++ member function with all fields included.\" width=\"1410\" height=\"1053\" \/><\/p>\n<h3><span class=\"TextRun SCXW163610163 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW163610163 BCX8\" data-ccp-parastyle=\"heading 1\">Future Work<\/span><\/span><\/h3>\n<p><span class=\"TextRun SCXW72076524 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW72076524 BCX8\">This experiment<\/span><span class=\"NormalTextRun SCXW72076524 BCX8\">al<\/span><span class=\"NormalTextRun SCXW72076524 BCX8\"> feature will be improved <\/span><span class=\"NormalTextRun SCXW72076524 BCX8\">by<\/span><span class=\"NormalTextRun SCXW72076524 BCX8\"> adding more functions that can save you a lot of typing. Right <\/span><span class=\"NormalTextRun SCXW72076524 BCX8\">now,<\/span><span class=\"NormalTextRun SCXW72076524 BCX8\"> it includes constructor and <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW72076524 BCX8\">equality operator<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\"> (<\/span><\/span><code class=\"language-default\">operator==<\/code><span class=\"TextRun SCXW72076524 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">)<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW72076524 BCX8\"> only, <\/span><span class=\"NormalTextRun SCXW72076524 BCX8\">and<\/span><span class=\"NormalTextRun SCXW72076524 BCX8\"> we are considering adding more cases,<\/span> <span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW72076524 BCX8\">such as <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">assignment, <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">swap<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">,<\/span> <span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">and<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\"> hash<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW72076524 BCX8\">, <\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW72076524 BCX8\">and would like to hear your feedback whether you are interested in these coming in future versions.<\/span><\/span><span class=\"EOP SCXW72076524 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span class=\"TextRun SCXW108672209 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW108672209 BCX8\">We have<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\"> a Dev<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">eloper <\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">Com<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">munity<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\"> ticket <\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">to<\/span> <\/span><a class=\"Hyperlink SCXW108672209 BCX8\" href=\"https:\/\/developercommunity.visualstudio.com\/t\/Improve-Create-Member-Function\/10309765\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW108672209 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW108672209 BCX8\" data-ccp-charstyle=\"Hyperlink\">Improve &#8220;Create Member Function&#8221;<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\" data-ccp-charstyle=\"Hyperlink\">,<\/span><\/span><\/a><span class=\"TextRun SCXW108672209 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW108672209 BCX8\"> if you have<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\"> the<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\"> same suggestion<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">s <\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">make sure to <\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">upvote <\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">it<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">.<\/span><span class=\"NormalTextRun SCXW108672209 BCX8\">\u00a0<\/span><\/span><span class=\"EOP SCXW108672209 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h3><span class=\"TextRun SCXW191253836 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW191253836 BCX8\" data-ccp-parastyle=\"heading 1\">Send us your feedback!<\/span><\/span><span class=\"EOP SCXW191253836 BCX8\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h3>\n<p><span class=\"TextRun SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW77263103 BCX8\">Download the<\/span> <\/span><a class=\"Hyperlink SCXW77263103 BCX8\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\" data-ccp-charstyle=\"Hyperlink\">latest version of Visual Studio Preview<\/span><\/span><\/a><span class=\"TextRun SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW77263103 BCX8\"> and give the Create C++ Member Function<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\"> feature<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\"> a try.<\/span> <span class=\"NormalTextRun SCXW77263103 BCX8\">Your feedback will be extremely helpful<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\"> in shaping this <\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">experience<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">, therefore, please <\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">continue to send <\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">your feedback <\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">in the comments below or\/and <\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">via<\/span> <\/span><a class=\"Hyperlink SCXW77263103 BCX8\" href=\"https:\/\/developercommunity.visualstudio.com\/cpp\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\" data-ccp-charstyle=\"Hyperlink\">Developer Community<\/span><\/span><\/a><span class=\"TextRun SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\">. <\/span><\/span><span class=\"TextRun Highlight SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\">You can also reach us on Twitter<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\"> (<\/span><\/span><a class=\"Hyperlink SCXW77263103 BCX8\" href=\"https:\/\/twitter.com\/visualc\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\" data-ccp-charstyle=\"Hyperlink\">@VisualC<\/span><\/span><\/a><span class=\"TextRun Highlight SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\">)<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">, or via email at<\/span> <\/span><a class=\"Hyperlink SCXW77263103 BCX8\" href=\"mailto:visualcpp@microsoft.com\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Highlight Underlined SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\" data-ccp-charstyle=\"Hyperlink\">visualcpp@microsoft.com<\/span><\/span><\/a><span class=\"TextRun Highlight SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\">.<\/span><span class=\"NormalTextRun SCXW77263103 BCX8\">\u202f<\/span><\/span><span class=\"TextRun SCXW77263103 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW77263103 BCX8\">\u00a0<\/span><\/span><span class=\"EOP SCXW77263103 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce that Create C++ Member Function can now be used to quickly add constructor and equality operator (operator ==) in Visual Studio 17.6 Preview 2. When you have a class with fields, you can add a default constructor, constructor with all fields, equality operator, and equality operator with all fields easily. [&hellip;]<\/p>\n","protected":false},"author":96741,"featured_media":35994,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,3927],"tags":[],"class_list":["post-31987","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 that Create C++ Member Function can now be used to quickly add constructor and equality operator (operator ==) in Visual Studio 17.6 Preview 2. When you have a class with fields, you can add a default constructor, constructor with all fields, equality operator, and equality operator with all fields easily. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/31987","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=31987"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/31987\/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=31987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=31987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=31987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}