Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: Copy & Move

โญโญ intermediateโณ 35 min read๐Ÿ“ Lesson 91 of 204

One owning type with correct copy independence and a safe move โ€” the Rule of Five in miniature.

Write Sentence with the full ownership discipline:

  • one std::vector member means the compiler-generated copies are already deep โ€” but write the five operations yourself to see the machinery
  • joined() builds its string from words; no stored separator state
  • after std::move(a), a must still be destructible (it will be โ€” the vector member handles it) while c owns the words

If your copy tests pass but assignment leaks or double-frees, you have re-discovered why the Rule of Three exists.