Both virtual and override?

I see in the coding style guide:

“Use the virtual and override keywords when declaring an overriding method. When declaring a virtual function in a derived class, that overrides a virtual function in the parent class, you must use both the virtual and the override keywords.”

Anyone know why both are required by the style? virtual is redundant when override is specified, so it just adds to the verbosity.

Those specifications are in general for engine contributions.

For example when submitting a PR I follow Epic 100%, when doing external code I use auto-formatting scripts with whatever style I want to use in VisualStudio.

Yes - I understand that. If/when I submit anything of course I would follow the style.

Just trying to understand the rationale since it’s just more noise when trying to navigate/parse/understand the code.

Thought I might be missing a good reason - like a compiler that doesn’t support C++11 properly. :smiley:

The good reason is that it becomes more obvious what they’re doing. Half of the unreal code style is about writing as verbose as you can to help other readers.

Thanks Zeblote. I 100% agree that code should be written for humans. I don’t agree that verbosity (always) implies clarity.

The virtual keyword in this case doesn’t add any information or make anything easier to understand. A function declared using override is virtual so it’s completely redundant.

So I don’t understand how this makes it more obvious what they’re doing.

But we can disagree :slight_smile: Just wondered if I was missing something.