When exactly does the compiler create a virtual function table?
1) when the class contains at least one virtual function.
OR
2) when the immediate
The behavior is defined in chapter 10.3, paragraph 2 of the C++ language specification:
If a virtual member function vf is declared in a class Base and in a class Derived, derived directly or indirectly from Base, a member function vf with the same name and same parameter list as Base::vf is declared, then Derived::vf is also virtual ( whether or not it is so declared ) and it overrides Base::vf.
A italicized the relevant phrase. Thus, if your compiler creates v-tables in the usual sense then all classes will have a v-table since all their f() methods are virtual.