---
title: "Discussion on \"Declare virtual destructor for polymorphic base class\" | Hashnode"
description: "Discussion on \"Declare virtual destructor for polymorphic base class\". There are lots of ways to keep track of time, so it would be reasonable to create a TimeKeeper base class along with derived classes for different approaches to timekeeping\nclass TimeKeeper {\npublic:\n    TimeKeeper();\n    ~TimeKeeper();\n    ...\n};\n\nc..."
url: "https://hashnode.com/posts/declare-virtual-destructor-for-polymorphic-base-class/6417004c8e74006eeeeeb5b2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Declare virtual destructor for polymorphic base class](https://kangaroolove.hashnode.dev/declare-virtual-destructor-for-polymorphic-base-class?utm_source=hashnode&utm_medium=feed)

There are lots of ways to keep track of time, so it would be reasonable to create a TimeKeeper base class along with derived classes for different approaches to timekeeping class TimeKeeper { public: TimeKeeper(); ~TimeKeeper(); ... }; c...

Mar 19, 2023 · 1 min read · kangaroolove.hashnode.dev  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)
-   [#virtual-destructor](https://hashnode.com/tag/virtual-destructor)

## Written by

[Kangaroo](https://hashnode.com/@KangarooLove)

@KangarooLove · Singapore

  
[View profile](https://hashnode.com/@KangarooLove)

Solo leveling

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
