tags:

views:

134

answers:

3

"Virtual" is qualifier or keyword in C++?

+3  A: 

It's both a qualifier and a keyword!

Oli Charlesworth
+3  A: 

'virtual' is a keyword and a qualifier. C++ is case sensitive and won't understand 'Virtual'.

Chubsdad
+12  A: 

virtual is a keyword and a function-specifier. It's not a qualifier. C++ only talks about cv-qualifiers (i.e. const and volatile); the only other uses of the word qualifier refer to scope resolution prefixes (i.e. global :: and ns:: and class_name:: prefixes) in qualified ids.

Charles Bailey
And the C++ spec talks about a template name to be "explicitly qualified by the template arguments". It also uses the term during overload resolution to say "x.foo" is a qualified call and "foo" (as well as "x::foo") etc is an unqualified call. I find that confusing though :
Johannes Schaub - litb