Skip to main content

Practice ยท 1 of 1

Ownership Transfer

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.

Difficulty: beginner

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