virtual and inline are function specifier.
They can appear before function only.{as per my understanding}.
Then,In following code what is virtual?
class Base
{
//
};
class Derived :virtual public Base
{
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your question is about the wording in the standard, then you must have misunderstood it. It is true that the list of various function specifiers includes the keyword
virtualas one possible function specifier. However, it doesn’t work in other direction: the keywordvirtualis not restricted to being the function specifier only. It has other use(s). You have found an example of that – it can be used to declare virtual base classes.