Moving is not a magic speed spell.
Your AI added std::move everywhere. The benchmark? Vibes, apparently.
The mess
You ask for faster code. The AI adds std::move everywhere. No benchmark, just aggressive punctuation. Performance engineering has apparently become a religion.
A copy follows the type's copy behavior. A move may transfer resources. std::move itself is just a cast that allows move-aware operations to be selected. Writing “MOVE” on a box doesn't carry your sofa.
std::string draft = "ship it";
std::string published = std::move(draft);
// Assuming draft is empty? That's a guess wearing a lab coat.
Here published receives the previous text. draft remains valid, but its value is unspecified. Empty isn't promised.
The fix
Don't assume the old contents survive, either. You can assign a new value or check empty(); calling front() requires a nonempty string. For user-written types, check their contract.
Returning by value may already avoid copies. Adding std::move to a named local return can inhibit named return value optimization. Yes, your optimization can sabotage an optimization. Very on-brand.
Ask your AI
Which operations copy, move, or allow copy elision? Check every moved-from use. Justify performance changes with measurements.
“It has move in the name” is not a benchmark.
Receipts: Moved-from objects · Move helpers · Copy elision.
Did that actually stick?
Three questions. “The AI said so” is not an answer.