cpp-move-semantics
Installation
SKILL.md
C++ Move Semantics & Use-After-Move
When to use
- Choosing how to pass or return an object (by value, rvalue reference, forwarding reference).
- A class needs move construction/assignment or a rule-of-five decision.
std::moveorstd::forwardappears in code and must do the right thing.- Debugging why "moving" actually copies, or why a moved-from object lost its value.
- Deciding whether a
returncopies, moves, or is elided.
When not to use
- Lifetime, construction-order, and dangling issues — use
cpp-object-lifecycle. - Undefined behavior taxonomy (null-deref UB in general) — use
c-undefined-behavior. - Ownership/RAII API design — use
raii-descriptor-types-api-design. - Rust ownership — use
rust-unsafe-reasoning.