m12-lifecycle/SKILL.md
Mastering C++ Lifecycle: RAII, Destructors, Static Initialization, Rule of 5.
npx skillsauth add 13eholder/modern-cpp-skills m12-lifecycleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When does this die?
}.delete (or smart pointer drop) occurs.| Issue | Design Question |
| ------------------ | ------------------------------------------------------------------- |
| Resource Leak | Did you manually open() without a wrapper class? |
| Use After Free | Did you capture a reference to a local variable in a lambda/thread? |
| Static Fiasco | Do statics depend on each other? (Use Meyers Singleton). |
Does it have a destructor?
Does it copy?
FILE* cannot copy. Delete copy constructor.| Pattern | Use Case |
| ---------------- | ------------------------------------------ |
| RAII Wrapper | FileHandle, LockGuard. |
| Scope Guard | std::scope_exit (Cleanup callback). |
| Rule of 5 | Copy/Move/Destructor implementation logic. |
tools
Common C++ Anti-Patterns. Triggers: global variables, new/delete, C-style cast, macros, void*.
data-ai
C++ Mental Models: Pointer vs Reference, Initialization, Undefined Behavior.
data-ai
Mastering C++ Domain Errors: Exception Hierarchies, System Errors, and Expected.
tools
Mastering C++ Ecosystem: CMake, vcpkg, Conan, Sanitizers, Tooling.