<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf" -->

---
title: Two cases when forward declaring is not enough | daily.dev
description: Two cases when forward declaring is not enough: a &#x27;missing&#x27; destructor and covariant return types in overrides.
canonical: https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Two cases when forward declaring is not enough | daily.dev
og:description: Two cases when forward declaring is not enough: a &#x27;missing&#x27; destructor and covariant return types in overrides.
og:url: https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf
og:image: https://api.daily.dev/og/posts/OUEyW01wF.png
og:image:alt: Two cases when forward declaring is not enough
og:image:width: 1200
og:image:height: 630
og:locale: en
---

[Sandor Dargo](https://daily.dev/sources/sandordargo)

[Read post](https://api.daily.dev/r/OUEyW01wF)

# [Two cases when forward declaring is not enough](https://api.daily.dev/r/OUEyW01wF "Go to post")

Two cases when forward declaring is not enough: a 'missing' destructor and covariant return types in overrides.

[#c](/tags/c "Check all #c posts")

May 15, 2024•5m read time•From [sandordargo.com](https://api.daily.dev/r/OUEyW01wF "sandordargo.com")

[![Post cover image](https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuiZ)](https://api.daily.dev/r/OUEyW01wF "Go to post")

Table of contents

[The case of the “missing” destructor](https://api.daily.dev/r/OUEyW01wF?a=the-case-of-the-missing-destructor "The case of the “missing” destructor")[Covariant return types](https://api.daily.dev/r/OUEyW01wF?a=covariant-return-types "Covariant return types")[Conclusion](https://api.daily.dev/r/OUEyW01wF?a=conclusion "Conclusion")[Connect deeper](https://api.daily.dev/r/OUEyW01wF?a=connect-deeper "Connect deeper")

98 Impressions

Comment

Bookmark

Copy

![Placeholder image for anonymous user](https://media.daily.dev/image/upload/s--qsFuKGv_--/t_logo,f_auto/public/noProfile)Share your thoughtsPost

[![Sandor Dargo's image](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/48d17993e5864d66951193405fa786bb)](https://daily.dev/sources/sandordargo)

[Sandor Dargo](https://daily.dev/sources/sandordargo "https://daily.dev/sources/sandordargo")

Sandor Dargo's blog provides practical insights into software development, Agile methodologies, and ... Read more

38 Followers

•

285 Upvotes

#### Would you recommend this post?

Copy link

WhatsApp

Facebook

X

New Squad

Copy linkShare with your friends

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Two cases when forward declaring is not enough","url":"https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf"},"datePublished":"2024-05-15T20:33:21.273Z","dateModified":"2024-05-15T20:33:19.339Z","description":"Two cases when forward declaring is not enough: a 'missing' destructor and covariant return types in overrides.","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc56fe31dfb8fc6b112ce220016c1fe6?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Sandor Dargo","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sandor Dargo","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/48d17993e5864d66951193405fa786bb","url":"https://daily.dev/sources/sandordargo"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/two-cases-when-forward-declaring-is-not-enough-oueyw01wf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sandor Dargo","item":"https://daily.dev/sources/sandordargo"},{"@type":"ListItem","position":3,"name":"Two cases when forward declaring is not enough"}]}
```

