Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Adding a virtual function adds virtual+override
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xMRi
Tomato Guru

Germany
315 Posts

Posted - Feb 24 2021 :  08:38:49 AM  Show Profile  Reply with Quote
When I add a virtual function with the refactoring the function is added with the keywords virtual and override.

But the code inspector says that the virtual keyword can be removed.
Doesn't really make sense.

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Feb 24 2021 :  09:04:45 AM  Show Profile  Reply with Quote
Adding the virtual keyword is controlled via the setting:

VA Options -> Code Generation -> Use virtual keyword for generated C++ methods

and adding the override keyword is controlled via the setting:

VA Options -> Code Generation -> Use override keyword for generated C++ methods

I need to check the default settings and read up on these keywords

zen is the art of being at one with the two'ness
Go to Top of Page

xMRi
Tomato Guru

Germany
315 Posts

Posted - Feb 25 2021 :  02:59:34 AM  Show Profile  Reply with Quote
Ok. Thanks. I missed the settings.
I never changed them. So I assume that I use the defaults.

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Feb 25 2021 :  11:19:24 AM  Show Profile  Reply with Quote
The option names have changed slightly since I last updated the notes I copy and paste them from, oops. In VA 2399 the option is now:

VA Options -> Code Generation -> Add keyword to generated C++ methods: override / virtual / virtual and override

where you pick one of the three options from the pull down list, and the default for a clean install of VA is "override", which is what Code Inspection recommends.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000