Background
I just stumbled upon the option of using a overridespecifier , which, as far as I can tell, seems redundant, and without any specific semantics it means, but maybe something is missing for me, so this question. Before continuing, I must indicate that I tried to find the answer to it here on SO, but the closest I received the following streams without responding to my request (maybe someone can specify Q & A, which actually already answers on my question).
Question
Consider the following abstract class:
struct Abstract {
virtual ~Abstract() {};
virtual void foo() = 0;
};
override foo() - , Abstract ( DerivedB )? I.e., foo() , ( -)?
struct DerivedA : public Abstract {
virtual void foo() { std::cout << "A foo" << std::endl; }
};
struct DerivedB : public Abstract {
virtual void foo() override { std::cout << "B foo" << std::endl; }
};