Video není dostupné.
Omlouváme se.

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

Sdílet
Vložit
  • čas přidán 7. 08. 2024
  • A "hidden feature" in C++ is that we actually can provide an implementation for a pure virtual function in its own abstract class, in this video we discuss how and why to do this. Source code: github.com/portfoliocourses/c.... Check out www.portfoliocourses.com to build a portfolio that will impress employers!

Komentáře • 1

  • @harishkuppam5756
    @harishkuppam5756 Před rokem

    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?