Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Extend Code Inspection - Override checker

You must be registered to post a reply.
Click here to register.

Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji

Forum code is on.
Html is off.

Check to subscribe to this topic.

T O P I C    R E V I E W
Vladyslav Posted - Oct 31 2021 : 06:26:59 AM
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?
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 14 2021 : 1:29:59 PM
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

Vladyslav Posted - Dec 07 2021 : 12:50:28 PM
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`.
feline Posted - Nov 01 2021 : 08:16:03 AM
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.

© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000