Exercise: Copy-and-Swap Idiom
Test your understanding of the copy-and-swap idiom.
We'll cover the following
Problem statement
Make two objects of the Foo
class and swap them by writing the swap
method for the Foo
class.
Expected output
You can show the swapped names of the two objects using the print
function given in the Foo
class.
Coding challenge
Get hands-on with 1400+ tech skills courses.