Checkpoint: Copy & Move
Challenge on lesson: Checkpoint: Copy & Move
CHALLENGE
Difficulty: intermediate+25 XP
Implement class Sentence owning a std::vector<std::string> words_ (rule of three/five, deep semantics). Provide void add(std::string w), std::size_t size() const, and std::string joined() const returning words separated by single spaces. The test copies one Sentence, mutates the copy, and verifies independence, then moves a temporary into a vector.
Press Submit to check your solution.
Back to lesson: Checkpoint: Copy & Move