static vs dynamic polymorphism c++