Consider the case where a
virtual function
in base class isnot overriden
in the derived class. Then using abase class pointer to a derived class object
the virtual function is invoked.
I understand that the function invocation will be resolved to the function in the base class during compile-time.
Question
Since the function is not overriden in the derived class, will the function call be bound to the function implementation during compile-time or will it still delay the binding until run-time?
Most likely it will be resolved at compile time.
Most of the modern day compilers are smart enough to resolve dynamic dispatch at compilation time if there is enough credible information for them to decide so.
In this case since no overriding function is provided in the Derived class a smart compiler should be able to resolve the function call at compilation time statically.