Hidden Feature: Implement A Pure Virtual Function In Its Own Abstract Class | C++ Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

If we need to maintain the total length of logged messages, we are required to call the base call virtual function in all the derived classes right so doesn't that make this code anti-pattern? I know it won't cause any error if we don't call the virtual function in derived class but the whole purpose of implementing the function in Base class is lost if we don't call it in all the derived classes right?

harishkuppam