Abstract Classes - Polymorphism

  • + 10 comments

    Well, the first and the main question here - where is polymorphism? The main() function doesn't use abstract class at all - it defines and solely uses LRUCache instance, while correct implementation would require a pointer to the base class to be used.

    Second. We all have access to std::list<> which provides way better implementation of the linked list than custom made code in the Cache class.

    So, I defined class LRUCache as standalone and used pair of standard STL containers to hold the cache and registry.