Pitfalls¶
Every English failure mode, with the fix it implies.
Concurrency¶
- Broken Double-Checked Locking
- Data Race
- Deadlock
- Livelock
- Memory Order Pitfalls
- Priority Inversion
- The Myth of Thread Safety
- Thread Leak
- Concurrency Pitfall: The Thread-Safety Composition Fallacy
Containers & Iterators¶
Templates & Language¶
- Fold Expression Errors
- Implicit Conversions
- Macro Pitfalls
- Narrowing Conversions in Initialization
- SFINAE Misuse
- Signed Integer Overflow Assumptions
- Stack Overflow
- Template Argument Deduction Pitfalls
- Template Specialization Pitfalls
Lifetime & Ownership¶
- Const Correctness Pitfalls
- Move Semantics Trap: Moving from a const Object
- Dangling Lambda Captures
- Dangling Pointer
- Dangling std::string_view
- Deleting Through a Non-Virtual Base Pointer
- Double Free
- Memory Fragmentation
- Memory Leaks
- Moving from a const Object
- Object Lifetime and Destruction Order Pitfalls
- Object Slicing
- Returning a Reference (or Pointer) to a Local Object
- Static Initialization Order Fiasco
- Throwing from a Destructor
- Uninitialized Member Variables
- Use After Move