Only virtual function come into vtbl. Friend can’t be virtual function,
because it’s not a member of class.
When a method is declared virtual in a base class, it is automatically
virtual in the derived class, but it is a good idea to explicitly declare it
by using the keyword virtual in the derived class declarations too.
Almost all the base class has virtual function, if a class doesn’tcontain a virtual function, It is an indication that it is notmeant to be used as a base class
Don’t rewrite non-virtual base member function, see effective c++
For overriding to occur, several requirements must be met:
The base class function must be virtual.
The base and derived function names must be identical (except in
the case of destructors).
The parameter types of the base and derived functions must be
identical.
The constness of the base and derived functions must be identical.
The return types and exception specifications of the base and
derived functions must be compatible.
To these constraints, which were also part of C++98, C++11 adds
one more: The functions’ reference qualifiers must be identical.