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
 Feature Requests
 Extend Code Inspection - Override checker
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Vladyslav
New Member

Ukraine
2 Posts

Posted - Oct 31 2021 :  06:26:59 AM  Show Profile  Reply with Quote
In Code Inspection tool, there is a checker "Overriding function without `override` specifier".
It is an amazing feature for supporting obsolete projects.
But it became annoying when `final` keyword is used.
In my code:
- all virtual functions have `virtual` prefix;
- all overridden function have `override` prefix;
If function have to be final I write it fully:
virtual void Foo() override final;

But this checker says "Remove redundant `virtual` and `override`" for lines with `final`.
Can you add some settings to not show such warnings?

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Nov 01 2021 :  08:16:03 AM  Show Profile  Reply with Quote
Is there a reason you don't want to remove the "virtual" and "override" keywords? You don't need them, since you have specified "final".

I am wondering if this is your preference, or if there is an actual reason you need both keywords.

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

Vladyslav
New Member

Ukraine
2 Posts

Posted - Dec 07 2021 :  12:50:28 PM  Show Profile  Reply with Quote
It is my preference. I have an argument, but it is weak.

When I open any header file, I want to see all virtual functions. If the keyword `virtual` is used - I can observe quickly such functions, because `virtual` is placed at the beginning of each function and aligned.
It is especially useful when the declaration does not fit to one screen, and to see `override`/`final` you need to scroll right.

About `override`+`final`, actually, I think there is no benefits to combine these 2 keywords, and it is fine if `final` replaces `override`.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 14 2021 :  1:29:59 PM  Show Profile  Reply with Quote
That makes sense, I have put in a feature request to see what our developers make of this.

For now, have you considered placing the virtual methods into a region, this way you can easily tell which ones are virtual, since they are grouped together. VA Outline reports regions in C++, allowing you an easy way of identifying them:

#pragma region Virtual members
#pragma endregion Virtual members


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