Smart Pointers, Dumb Mistakes

Khushboo Verma

⏱ 60 minute session
beginner
intermediate
advanced
09:30-10:30, Wednesday, 25th June 2025

C++ smart pointers promise to make memory management easier—but they also introduce a new world of gotchas, performance quirks, and hidden complexities. From unique_ptr ownership mix-ups to shared_ptr reference cycles, even experienced developers fall into subtle traps that lead to memory leaks, undefined behavior, or just plain bad performance.

This session dives deep into modern C++ memory management, exploring both the power and pitfalls of smart pointers. We’ll start by revisiting raw pointers (because, yes, they still matter) before dissecting unique_ptr, shared_ptr, and weak_ptr—how they work, when to use them, and how they can backfire. Along the way, we’ll unravel aliasing surprises, control block overhead, exception safety risks, and the lesser-known optimizations in C++20+.

Expect real-world mistakes, debugging horror stories, and practical solutions using Address Sanitizer, static analysis tools, and modern C++ techniques. By the end, you'll walk away with the confidence to write memory-safe, performant code—without falling into the "smart" pointer traps.


🏷 Pointers
🏷 Smart Pointers
🏷 Classes
🏷 STL
🏷 Move Semantics

Khushboo Verma

Khushboo Verma is a software engineer at Appwrite with experience in cloud computing, backend engineering, and distributed systems. Her primary expertise is in C++ and PHP. As a Docker Captain and open-source contributor, she loves to continuously learn and share about advancements in technology. At her roles at Microsoft and Adobe, she has worked extensively on C++ in highly scalable distributed systems. She has delivered talks at 300+ national and international conferences, including PyCon JP 2024 and FOSSASIA Summit 2024. In her free time, Khushboo enjoys learning about system architectures and designs.