Top 10 dumb mistakes to avoid with C++ 11 smart pointers - A CODER'S JOURNEY
I love the new C++ 11 smart pointers. In many ways, they were a godsent for many folks who hate managing their own memory. In my opinion, it made teaching C++ to newcomers much easier. However, in the two plus years that I've been using them extensively, I've come across multiple cases where improper use …
ALL CODE CRAFT May 15, 2016 Deb Haldar I love the new C++ 11 smart pointers. In many ways, they were a godsent for many folks who hate managing their own memory. In my opinion, it made teaching C++ to newcomers much easier. However, in the two plus years that I've been using them extensively, I've come across multiple cases where improper use of the C++ 11 smart pointers made the program inefficient or simply crash and burn. I've catalogued them below for easy reference. Before we begin, let's take a look at a simple Aircraft class we'll use to illustrate the mistakes. class Aircraft { private
saved by
related reading
- CppCon 2019: Arthur O'Dwyer “Back to Basics: Smart Pointers”youtube.com
- Back to Basics: Move Semantics - David Olsen - CppCon 2020youtube.com
- Moves - Rust: A Better C++ Than C++thecodedmessage.com
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- Learn C++ – Skill up with our free tutorialslearncpp.com
- What Every C Programmer Should Know About Undefined Behavior #2/3 - The LLVM Project Blogblog.llvm.org
- Destroy All Values: Designing Deinitialization in Programming Languages - Faultloregankra.github.io
- The worst programming language of all timeyoutube.com
- C++ Memory alignment - should we care? - Stack Overflowstackoverflow.com
- Untangling Lifetimes: The Arena Allocator - by Ryan Fleurydgtlgrove.com
- C++11 Memory Modelpeople.cs.pitt.edu
- My tutorial and take on C++20 coroutinesscs.stanford.edu