Skip to main content

Practice · 1 of 1

Ownership Transfer

CHALLENGE
Difficulty: beginner+25 XP

Implement make_counter() returning std::unique_ptr<int> holding 0, and take_and_bump(std::unique_ptr<int> p) that increments the value and RETURNS the same pointer onward.

Back to lesson: Practice: RAII Practice: Own It Once