Elektrine lite

← Feed

@jakub_neruda@techhub.social

Post #718173

2026-03-20 20:03 UTC

Recently, I made a stupid mistake that made me think about the way C++ APIs handle dependencies and what we can do to prevent dangling references and lifetime issues. 🤔 It was a surprisingly fun topic to explore that led me to the discovery of a very cool static analysis tool. Can you guess which one? 😎 You can find out in the article I wrote about the topic here: ➤ https://medium.com/@nerudaj/type-safe-dependency-management-in-c-a293703f00ff #cpp #StaticAnalysis #SoftwareEngineering

Replies (1)

  • @asperamanca@mastodon.social 2026-03-21 09:49

    @jakub_neruda@techhub.social I would add one more option: Implicit sharing. It uses shared pointers internally, but behaves like a copied value to the outside. It will only do a deep copy if someone wants to change their copy. In your example, you would probably just pass ownership of AnimationStates, no copy, no crash. Does make it somewhat harder to debug memory leaks.

    Open ##4254460