{"id":1917,"date":"2021-04-01T00:51:56","date_gmt":"2021-04-01T04:51:56","guid":{"rendered":"https:\/\/blog.wholetomato.com\/?p=1917"},"modified":"2023-11-21T06:39:33","modified_gmt":"2023-11-21T10:39:33","slug":"how-to-modernize-with-visual-assist-part-2","status":"publish","type":"post","link":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/","title":{"rendered":"How To Modernize With Visual Assist Part 2"},"content":{"rendered":"\r\n<p>In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here&#8217;s a list of five more things! We&#8217;ll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist!<\/p>\r\n\r\n<h2><span style=\"color: #4f81bd;\"><strong>1. <span style=\"color: #4f81bd;\">Override<\/span><\/strong><\/span><\/h2>\r\n<p>Let&#8217;s have a look at the following code with a simple class hierarchy:<\/p>\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">using BmpData = std::vector&lt;int&gt;;\r\n\r\nclass BaseBrush {\r\npublic:\r\nvirtual ~BaseBrush() = default;\r\n\r\nvirtual bool Generate() = 0;\r\n\r\nvirtual BmpData ApplyFilter(const std::string&amp;) { return BmpData{}; }\r\n};\r\n\r\nclass PBrush : public BaseBrush {\r\npublic:\r\nPBrush() = default;\r\n\r\nbool Generate() { return true; }\r\n\r\nBmpData ApplyFilter(const std::string&amp; filterName) {\r\nstd::cout &lt;&lt; \"applying filter: \" &lt;&lt; filterName;\r\nreturn BmpData{};\r\n}\r\n\r\nprivate:\r\nBmpData m_data;\r\n};<\/pre>\r\n\r\n\r\n\r\n<p>When you run VA code inspections, you&#8217;ll immediately see that it complains about not using the override keyword on those two virtual methods.<\/p>\r\n\r\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1874\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/everything-you-need-to-know-about-code-inspections\/image1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?fit=752%2C382&amp;ssl=1\" data-orig-size=\"752,382\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?fit=300%2C152&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?fit=752%2C382&amp;ssl=1\" class=\"alignnone size-full wp-image-1874\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?resize=752%2C382&#038;ssl=1\" alt=\"image1\" width=\"752\" height=\"382\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?w=752&amp;ssl=1 752w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?resize=300%2C152&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image1.png?resize=360%2C183&amp;ssl=1 360w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" data-recalc-dims=\"1\" \/><\/p>\r\n<p>In short, the override keyword allows us to explicitly specify that a given member function overrides a function from a base class. It&#8217;s a new keyword available since C++11.<\/p>\r\n<p>As you might already know, you can go to VA <a href=\"https:\/\/www.wholetomato.com\/blog\/2023\/03\/10\/eliminating-code-smells-with-visual-assist-code-inspection-webinar-recap\/\" target=\"_blank\" rel=\"noopener\">Code Inspection<\/a> Results and apply the fixes automatically. You&#8217;ll get the following code:<\/p>\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">class PBrush : public BaseBrush {\r\npublic:\r\nPBrush() = default;\r\n\r\nbool Generate() override;\r\n\r\nBmpData ApplyFilter(const std::string&amp; filterName) override;\r\nprivate:\r\nBmpData m_data;\r\n};<\/pre>\r\n\r\n\r\n\r\n<p>What are the benefits of using override?<\/p>\r\n\r\n\r\n\r\n<p>The most significant advantage is that we can now easily catch mismatches between the virtual base function and its override. When you have even a slight difference in the declaration, then the virtual polymorphism <em>will <\/em><s>might<\/s> not work.\u00a0<\/p>\r\n\r\n\r\n\r\n<p>Another critical point is code expressiveness. With override, it&#8217;s effortless to read what the function is supposed to do.<\/p>\r\n\r\n\r\n\r\n<p>And another one is being more modern as this keyword is also available in other languages like C#, Visual Basic, Java, and Delphi.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"has-text-color wp-block-heading\" style=\"color: #4f81bd;\"><strong>2. <\/strong><strong>nullptr<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>When I work with legacy code, my Visual Assist Code Inspection Result is often filled with lots of the following items:<\/p>\r\n\r\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1889\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/image3\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?fit=867%2C411&amp;ssl=1\" data-orig-size=\"867,411\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?fit=300%2C142&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?fit=867%2C411&amp;ssl=1\" class=\"alignnone size-full wp-image-1889\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?resize=867%2C411&#038;ssl=1\" alt=\"image3\" width=\"867\" height=\"411\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?w=867&amp;ssl=1 867w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?resize=768%2C364&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image3.png?resize=360%2C171&amp;ssl=1 360w\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" data-recalc-dims=\"1\" \/><\/p>\r\n<p><span style=\"font-weight: 400;\">This often happens with code like:<\/span><\/p>\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">if (pInput == NULL) {\r\n    LOG(Error, \"input is null!\")\r\n    return;\r\n}<\/pre>\r\n\r\n\r\n\r\n<p>or<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">pObject-&gt;Generate(\"image.bmp\", NULL, NULL, 32);<\/pre>\r\n\r\n\r\n\r\n<p>Why does Visual Assist complain about the code? It&#8217;s because NULL is just a define and means only 0, so it doesn&#8217;t mean a null pointer, but it means 0. This is also a problem when you have code like:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">int func(int param);\r\nint func(float* data);\r\nif you call:\r\nfunc(NULL);\r\n<\/pre>\r\n\r\n\r\n\r\n<p>You could expect that the function with the pointer should be called, but it&#8217;s not. That&#8217;s why it&#8217;s often a guideline in C or early C++ that suggests not making function overrides with pointers and integral types.<\/p>\r\n\r\n\r\n\r\n<p>The solution? Just use nullptr from C++11.<\/p>\r\n\r\n\r\n\r\n<p>nullptr is not 0, but it has a distinct type nullptr_t.<\/p>\r\n\r\n\r\n\r\n<p>Now when you write:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">func(nullptr);<\/pre>\r\n\r\n\r\n\r\n<p>you can expect the proper function invocation. The version with func(float* data) will be invoked.<\/p>\r\n\r\n\r\n\r\n<p>Not to mention that nullptr is a separate keyword in C++, so it stands out from the regular code. Sometimes NULL is displayed in a different color, but sometimes it is not.<\/p>\r\n\r\n\r\n\r\n<p>Visual Assist makes it super easy to apply the fix, and it&#8217;s a very safe change.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"has-text-color wp-block-heading\" style=\"color: #4f81bd;\"><strong>3. Convert <\/strong><strong>enum<\/strong><strong> to scoped <\/strong><strong>enum<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>Another pattern that is enhanced with Modern C++ is a way you can define enums.<\/p>\r\n\r\n\r\n\r\n<p>It was popular to write the following code:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">enum ActionType {\r\n    atNone,\r\n    atProcess,\r\n    atRemove,\r\n    atAdd\r\n};\r\n\r\nActionType action = atNone;\r\nSince C++11 it's better to you can define this type in the following way:\r\nenum class ActionType {\r\n    None,\r\n    Process,\r\n    Remove,\r\n    Add\r\n};\r\n\r\nActionType action = ActionType::None;<\/pre>\r\n\r\n\r\n\r\n<p>What are the benefits of such transformations?<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>They don&#8217;t pollute the global namespace. As you may have noticed, it was often necessary to add various prefixes so the names wouldn&#8217;t clash. That&#8217;s why you see atNone. But in the scoped enum version, we can write None.<\/li>\r\n<li>You get strong typing, and the compiler will warn when you want to convert into some integral value accidentally.<\/li>\r\n<li>You can forward scope enums and thus save some file dependencies.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>What&#8217;s best about Visual Assist is that it has a separate tool to convert unscoped enums to enum classes, all with proper renames and changes in all places where this particular type was used. Right-click on the type and select &#8220;Convert Unscoped Enum to Scoped Enum.&#8221;. This opens a preview window where you can see and select which references will be replaced.<\/p>\r\n\r\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1888\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/image2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?fit=1239%2C618&amp;ssl=1\" data-orig-size=\"1239,618\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?fit=300%2C150&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?fit=1024%2C511&amp;ssl=1\" class=\"alignnone size-full wp-image-1888\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=1140%2C569&#038;ssl=1\" alt=\"image2\" width=\"1140\" height=\"569\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?w=1239&amp;ssl=1 1239w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=300%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=1024%2C511&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=768%2C383&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=1200%2C599&amp;ssl=1 1200w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image2.png?resize=360%2C180&amp;ssl=1 360w\" sizes=\"auto, (max-width: 1140px) 100vw, 1140px\" data-recalc-dims=\"1\" \/><\/p>\r\n<p><span style=\"font-weight: 400;\">Read more in <\/span><a href=\"https:\/\/docs.wholetomato.com\/default.asp?W861\"><span style=\"font-weight: 400;\">Convert Unscoped Enum to Scoped Enum<\/span><\/a><span style=\"font-weight: 400;\"> in the VA documentation.<\/span><\/p>\r\n\r\n<h2 class=\"has-text-color wp-block-heading\" style=\"color: #4f81bd;\"><strong>4. Use more <\/strong><strong>auto<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>One of the key characteristics of Modern C++ is shorter and more expressive code. You saw one example where we converted from for loops with long names for iterators into a nice and compact range-based for loops.<\/p>\r\n\r\n\r\n\r\n<p>What&#8217;s more, we can also apply shorter syntax to regular variables thanks to automatic type deduction. In C++11, we have a &#8220;reused&#8221; keyword auto for that.<\/p>\r\n\r\n\r\n\r\n<p>Have a look:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">std::vector&lt;int&gt; vec { 1, 2, 3, 4, 5, 6, 7, 8};\r\nstd::vector&lt;int&gt;::const_iterator cit = vec.cbegin();<\/pre>\r\n\r\n\r\n\r\n<p>We can now replace it with:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">std::vector&lt;int&gt; vec { 1, 2, 3, 4, 5, 6, 7, 8};\r\nauto cit = vec.cbegin();<\/pre>\r\n\r\n\r\n\r\n<p>Previously, template-type deduction worked only for functions, but now it&#8217;s enabled for variables. It&#8217;s similar to the following code:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">template &lt;typename T&gt; func(T cit) {\r\n    \/\/ use cit...\r\n}\r\nstd::vector&lt;int&gt; vec { 1, 2, 3, 4, 5, 6, 7, 8};\r\nfunc(vec.cbegin()); \/\/ template deduction here!<\/pre>\r\n\r\n\r\n\r\n<p>Following are some other examples:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">auto counter = 0;   \/\/ deduced int\r\nauto factor = 42.5; \/\/ deduces double\r\nauto start = myVector.begin(); \/\/ deduces iterator type\r\nauto&amp; ref = counter; \/\/ reference to int\r\nauto ptr = &amp;factor;  \/\/ a pointer to double\r\nauto myPtr = std::make_unique&lt;int&gt;(42);\r\nauto lam = [](int x) { return x*x; };<\/pre>\r\n\r\n<p><span style=\"font-weight: 400;\">Have a look at the last line above. Without <\/span><span style=\"font-weight: 400;\">auto<\/span><span style=\"font-weight: 400;\">, it wouldn&#8217;t be possible to name a type of a lambda expression as it&#8217;s only known to the compiler and generated uniquely.<\/span><\/p>\r\n<p><span style=\"font-weight: 400;\">What do you get by using auto?<\/span><\/p>\r\n<ul>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Much shorter code, especially for types with long names<\/span><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Auto<\/span><span style=\"font-weight: 400;\"> variables must always be initialized, so you cannot write unsafe code in that regard<\/span><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Helps with refactoring when you want to change types<\/span><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Helps with avoiding unwanted conversions<\/span><\/li>\r\n<\/ul>\r\n<p><span style=\"font-weight: 400;\">As for other features, you&#8217;re also covered by Visual Assist, which can automatically apply <\/span><span style=\"font-weight: 400;\">auto<\/span><span style=\"font-weight: 400;\">. In many places, you&#8217;ll see the following suggestions:<\/span><\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1891\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/image5\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?fit=832%2C199&amp;ssl=1\" data-orig-size=\"832,199\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?fit=300%2C72&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?fit=832%2C199&amp;ssl=1\" class=\"alignnone size-full wp-image-1891\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?resize=832%2C199&#038;ssl=1\" alt=\"image5\" width=\"832\" height=\"199\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?w=832&amp;ssl=1 832w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?resize=300%2C72&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?resize=768%2C184&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image5.png?resize=360%2C86&amp;ssl=1 360w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" data-recalc-dims=\"1\" \/><\/p>\r\n<p><span style=\"font-weight: 400;\">This often happens in places like<\/span><\/p>\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">SomeLongClassName* pDowncasted = static_cast&lt;SomeLongClassName*&gt;(pBtrToBase); \r\n\/\/ no need to write SomeLongClassName twice:\r\nauto pDonwcasted = static_cast&lt;SomeLongClassName*&gt;(pBtrToBase);<\/pre>\r\n\r\n\r\n\r\n<p>or<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">unsigned int val = static_cast&lt;unsigned int&gt;(some_computation \/ factor);\r\n\/\/ just use:\r\nauto val = static_cast&lt;unsigned int&gt;(some_computation \/ factor);<\/pre>\r\n\r\n\r\n\r\n<p>As you can see, thanks to auto, we get shorter code and, in most cases, more comfortable to read. If you think that auto hides a type name for you, you can hover on it, and the Visual Studio will show you that name. Additionally, things like &#8220;go to definition&#8221; from Visual Assist work regularly.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"has-text-color wp-block-heading\" style=\"color: #4f81bd;\"><strong>5. Deprecated functionality<\/strong><\/h2>\r\n\r\n\r\n\r\n<p>With C++11, a lot of functionality was marked as deprecated and was removed in C++17. Visual Assist helps with conversion to new types and functions.<\/p>\r\n\r\n\r\n\r\n<p>For example, it&#8217;s now considered unsafe to use random_shuffle as it internally relied on simple rand(), which is very limited as a random function generator.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">std::vector&lt;int&gt; vec { 1, 2, 3, 4, 5, 6, 7, 8 };\r\nstd::random_shuffle(vec.begin(), vec.end());<\/pre>\r\n\r\n\r\n\r\n<p>Visual Assist can replace the above code with the following:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-syntaxhighlighter-code\">std::shuffle(vec.begin(), vec.end(), std::mt19937(std::random_device()()));<\/pre>\r\n\r\n\r\n\r\n<p>Additionally, you&#8217;ll get suggestions to improve old C-style headers and convert them into C++ style:<\/p>\r\n\r\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1890\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/image4\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?fit=710%2C231&amp;ssl=1\" data-orig-size=\"710,231\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image4\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?fit=300%2C98&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?fit=710%2C231&amp;ssl=1\" class=\"alignnone size-full wp-image-1890\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?resize=710%2C231&#038;ssl=1\" alt=\"image4\" width=\"710\" height=\"231\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?w=710&amp;ssl=1 710w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?resize=300%2C98&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/image4.png?resize=360%2C117&amp;ssl=1 360w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" data-recalc-dims=\"1\" \/><\/p>\r\n<h2><span style=\"color: #4f81bd;\"><b>Some other handy fixes<\/b><\/span><\/h2>\r\n<p><span style=\"font-weight: 400;\">We have covered a few inspections, but there&#8217;s much more! Here are some exciting items that you might want to see:<\/span><\/p>\r\n<ul>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Standard algorithm can be replaced by container&#8217;s more efficient implementation: <\/span><a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/performance-inefficient-algorithm.html\"><span style=\"font-weight: 400;\">clang-tidy &#8211; performance-inefficient-algorithm<\/span><\/a><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">typedef<\/span><span style=\"font-weight: 400;\"> can be converted to <\/span><span style=\"font-weight: 400;\">using<\/span><span style=\"font-weight: 400;\"> declaration: <\/span><a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/modernize-use-using.html\"><span style=\"font-weight: 400;\">clang-tidy &#8211; modernize-use-using<\/span><\/a><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Redundant call to <\/span><span style=\"font-weight: 400;\">c_str()<\/span><span style=\"font-weight: 400;\"> or <\/span><span style=\"font-weight: 400;\">data()<\/span><span style=\"font-weight: 400;\"> on <\/span><span style=\"font-weight: 400;\">string:<\/span> <a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/readability-redundant-smartptr-get.html\"><span style=\"font-weight: 400;\">clang-tidy &#8211; readability-redundant-smartptr-get<\/span><\/a><\/li>\r\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Optimize call to <\/span><span style=\"font-weight: 400;\">std::string::find()<\/span><span style=\"font-weight: 400;\"> to use single character literal: <\/span><a href=\"https:\/\/clang.llvm.org\/extra\/clang-tidy\/checks\/performance-faster-string-find.html\"><span style=\"font-weight: 400;\">clang-tidy &#8211; performance-faster-string-find<\/span><\/a><\/li>\r\n<\/ul>\r\n<p><span style=\"font-weight: 400;\">The whole list is available here: <\/span><a href=\"https:\/\/docs.wholetomato.com\/default.asp?W761\"><span style=\"font-weight: 400;\">List of Code Inspections<\/span><\/a><\/p>\r\n<h2><span style=\"color: #4f81bd;\"><b>Summary<\/b><\/span><\/h2>\r\n<p><span style=\"font-weight: 400;\">Thanks for reading our small series on Clang Tidy, Code Inspections, and Visual Assist. We covered a lot of items, and I hope you learned something new. The techniques I presented in most cases are very easy to use, especially thanks to VA support, and you can gradually refactor your code into Modern C++.<\/span><\/p>\r\n\r\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.wholetomato.com\/downloads\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"200\" data-attachment-id=\"1811\" data-permalink=\"https:\/\/www.wholetomato.com\/blog\/007_banner_wholetomato_resize_emiliano_600x200\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?fit=600%2C200&amp;ssl=1\" data-orig-size=\"600,200\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"007_banner_wholetomato_resize_emiliano_600x200\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?fit=300%2C100&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?fit=600%2C200&amp;ssl=1\" class=\"wp-image-1811\" src=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?resize=600%2C200&#038;ssl=1\" alt=\"\" srcset=\"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?resize=300%2C100&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/01\/007_banner_wholetomato_resize_emiliano_600x200.png?resize=360%2C120&amp;ssl=1 360w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" data-recalc-dims=\"1\" \/><\/a>\r\n<figcaption><a href=\"https:\/\/www.wholetomato.com\/downloads\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.wholetomato.com\/downloads<\/a><\/figcaption>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here&#8217;s a list of five more things! We&#8217;ll go from the override keyword to nullptr,&#8230;<\/p>\n","protected":false},"author":183830964,"featured_media":1943,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[672],"tags":[2426,54971,78684782,12004844,6678],"class_list":["post-1917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-and-tricks","tag-c","tag-c11","tag-modern-c","tag-visual-assist","tag-visual-studio"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/smartmockups_kmyeghw5.jpg?fit=1920%2C1080&ssl=1","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfpLS4-uV","aioseo_head":"\n\t\t<!-- All in One SEO Pro 4.9.6.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here&#039;s a list of five more things! We&#039;ll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let&#039;s have a look at the following\" \/>\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"Bartlomiej Filipek\"\/>\n\t<meta name=\"google-site-verification\" content=\"DtHrwoEjg0KG_fbuPSp5j_wNIf-g5hSh4EH6tZBoCIw\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 4.9.6.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Tomato Soup - Visual Assist Team Blog\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How To Modernize With Visual Assist Part 2 - Tomato Soup\" \/>\n\t\t<meta property=\"og:description\" content=\"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here&#039;s a list of five more things! We&#039;ll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let&#039;s have a look at the following\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-04-01T04:51:56+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-11-21T10:39:33+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wholetomatosoftware\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@visualassist\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How To Modernize With Visual Assist Part 2 - Tomato Soup\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here&#039;s a list of five more things! We&#039;ll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let&#039;s have a look at the following\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@visualassist\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#blogposting\",\"name\":\"How To Modernize With Visual Assist Part 2 - Tomato Soup\",\"headline\":\"How To Modernize With Visual Assist Part 2\",\"author\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/author\\\/bartlomiejfilipek6eba5efda2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.wholetomato.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/smartmockups_kmyeghw5.jpg?fit=1920%2C1080&ssl=1\",\"width\":1920,\"height\":1080},\"datePublished\":\"2021-04-01T00:51:56-04:00\",\"dateModified\":\"2023-11-21T06:39:33-04:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#webpage\"},\"articleSection\":\"Tips and Tricks, c++, c++11, modern c++, visual assist, Visual Studio, English\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/category\\\/tips-and-tricks\\\/#listItem\",\"name\":\"Tips and Tricks\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/category\\\/tips-and-tricks\\\/#listItem\",\"position\":2,\"name\":\"Tips and Tricks\",\"item\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/category\\\/tips-and-tricks\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#listItem\",\"name\":\"How To Modernize With Visual Assist Part 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#listItem\",\"position\":3,\"name\":\"How To Modernize With Visual Assist Part 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/category\\\/tips-and-tricks\\\/#listItem\",\"name\":\"Tips and Tricks\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/#organization\",\"name\":\"Tomato Soup\",\"description\":\"Visual Assist Team Blog\",\"url\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/\",\"email\":\"info@wholetomato.com\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":0,\"maxValue\":100},\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.wholetomato.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/wt-logo.jpg?fit=400%2C400&ssl=1\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#organizationLogo\",\"width\":400,\"height\":400},\"image\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/wholetomatosoftware\",\"https:\\\/\\\/twitter.com\\\/visualassist\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/Wholetomatosoftware\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/whole-tomato-software\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/author\\\/bartlomiejfilipek6eba5efda2\\\/#author\",\"url\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/author\\\/bartlomiejfilipek6eba5efda2\\\/\",\"name\":\"Bartlomiej Filipek\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#webpage\",\"url\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/\",\"name\":\"How To Modernize With Visual Assist Part 2 - Tomato Soup\",\"description\":\"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here's a list of five more things! We'll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let's have a look at the following\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/author\\\/bartlomiejfilipek6eba5efda2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/author\\\/bartlomiejfilipek6eba5efda2\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.wholetomato.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/smartmockups_kmyeghw5.jpg?fit=1920%2C1080&ssl=1\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#mainImage\",\"width\":1920,\"height\":1080},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/how-to-modernize-with-visual-assist-part-2\\\/#mainImage\"},\"datePublished\":\"2021-04-01T00:51:56-04:00\",\"dateModified\":\"2023-11-21T06:39:33-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/\",\"name\":\"Tomato Soup\",\"description\":\"Visual Assist Team Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.wholetomato.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>How To Modernize With Visual Assist Part 2 - Tomato Soup<\/title>\n\n","aioseo_head_json":{"title":"How To Modernize With Visual Assist Part 2 - Tomato Soup","description":"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here's a list of five more things! We'll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let's have a look at the following","canonical_url":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"","webmasterTools":{"google-site-verification":"DtHrwoEjg0KG_fbuPSp5j_wNIf-g5hSh4EH6tZBoCIw","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#blogposting","name":"How To Modernize With Visual Assist Part 2 - Tomato Soup","headline":"How To Modernize With Visual Assist Part 2","author":{"@id":"https:\/\/www.wholetomato.com\/blog\/author\/bartlomiejfilipek6eba5efda2\/#author"},"publisher":{"@id":"https:\/\/www.wholetomato.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/smartmockups_kmyeghw5.jpg?fit=1920%2C1080&ssl=1","width":1920,"height":1080},"datePublished":"2021-04-01T00:51:56-04:00","dateModified":"2023-11-21T06:39:33-04:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#webpage"},"isPartOf":{"@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#webpage"},"articleSection":"Tips and Tricks, c++, c++11, modern c++, visual assist, Visual Studio, English"},{"@type":"BreadcrumbList","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.wholetomato.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/#listItem","name":"Tips and Tricks"}},{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/#listItem","position":2,"name":"Tips and Tricks","item":"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#listItem","name":"How To Modernize With Visual Assist Part 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#listItem","position":3,"name":"How To Modernize With Visual Assist Part 2","previousItem":{"@type":"ListItem","@id":"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/#listItem","name":"Tips and Tricks"}}]},{"@type":"Organization","@id":"https:\/\/www.wholetomato.com\/blog\/#organization","name":"Tomato Soup","description":"Visual Assist Team Blog","url":"https:\/\/www.wholetomato.com\/blog\/","email":"info@wholetomato.com","numberOfEmployees":{"@type":"QuantitativeValue","minValue":0,"maxValue":100},"logo":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2020\/05\/wt-logo.jpg?fit=400%2C400&ssl=1","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#organizationLogo","width":400,"height":400},"image":{"@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/wholetomatosoftware","https:\/\/twitter.com\/visualassist","https:\/\/www.youtube.com\/c\/Wholetomatosoftware","https:\/\/www.linkedin.com\/company\/whole-tomato-software"]},{"@type":"Person","@id":"https:\/\/www.wholetomato.com\/blog\/author\/bartlomiejfilipek6eba5efda2\/#author","url":"https:\/\/www.wholetomato.com\/blog\/author\/bartlomiejfilipek6eba5efda2\/","name":"Bartlomiej Filipek"},{"@type":"WebPage","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#webpage","url":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/","name":"How To Modernize With Visual Assist Part 2 - Tomato Soup","description":"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here's a list of five more things! We'll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let's have a look at the following","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.wholetomato.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#breadcrumblist"},"author":{"@id":"https:\/\/www.wholetomato.com\/blog\/author\/bartlomiejfilipek6eba5efda2\/#author"},"creator":{"@id":"https:\/\/www.wholetomato.com\/blog\/author\/bartlomiejfilipek6eba5efda2\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.wholetomato.com\/blog\/wp-content\/uploads\/2021\/03\/smartmockups_kmyeghw5.jpg?fit=1920%2C1080&ssl=1","@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#mainImage","width":1920,"height":1080},"primaryImageOfPage":{"@id":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/#mainImage"},"datePublished":"2021-04-01T00:51:56-04:00","dateModified":"2023-11-21T06:39:33-04:00"},{"@type":"WebSite","@id":"https:\/\/www.wholetomato.com\/blog\/#website","url":"https:\/\/www.wholetomato.com\/blog\/","name":"Tomato Soup","description":"Visual Assist Team Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.wholetomato.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Tomato Soup - Visual Assist Team Blog","og:type":"article","og:title":"How To Modernize With Visual Assist Part 2 - Tomato Soup","og:description":"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here's a list of five more things! We'll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let's have a look at the following","og:url":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/","article:published_time":"2021-04-01T04:51:56+00:00","article:modified_time":"2023-11-21T10:39:33+00:00","article:publisher":"https:\/\/www.facebook.com\/wholetomatosoftware","twitter:card":"summary_large_image","twitter:site":"@visualassist","twitter:title":"How To Modernize With Visual Assist Part 2 - Tomato Soup","twitter:description":"In the previous article, you read about five popular techniques to improve your projects and apply several Modern C++ patterns. Here's a list of five more things! We'll go from the override keyword to nullptr, scoped enums, and more. All techniques are super-easy with Visual Assist! 1. Override Let's have a look at the following","twitter:creator":"@visualassist"},"aioseo_meta_data":{"post_id":"1917","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"open_ai":"{\"title\":{\"suggestions\":[],\"usage\":0},\"description\":{\"suggestions\":[],\"usage\":0}}","ai":null,"created":"2022-02-02 22:51:09","updated":"2025-05-29 19:50:14"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/www.wholetomato.com\/blog\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/\" title=\"Tips and Tricks\">Tips and Tricks<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\tHow To Modernize With Visual Assist Part 2\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.wholetomato.com\/blog"},{"label":"Tips and Tricks","link":"https:\/\/www.wholetomato.com\/blog\/category\/tips-and-tricks\/"},{"label":"How To Modernize With Visual Assist Part 2","link":"https:\/\/www.wholetomato.com\/blog\/how-to-modernize-with-visual-assist-part-2\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/posts\/1917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/users\/183830964"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/comments?post=1917"}],"version-history":[{"count":27,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/posts\/1917\/revisions"}],"predecessor-version":[{"id":3596,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/posts\/1917\/revisions\/3596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/media\/1943"}],"wp:attachment":[{"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/media?parent=1917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/categories?post=1917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wholetomato.com\/blog\/wp-json\/wp\/v2\/tags?post=1917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}