What is the swap operator? Why is swapping better than copying?
A24: One of the most important ideas of Resolve/C++ is the swapping paradigm. Briefly, the idea here is that in the real world, physical objects are not easily created and destroyed. Thus, when we manipulate objects in the real world, such as when we put a coin in a box, we are not creating copies (and destroying them), but rather changing the locations of the objects themselves. However, in traditional programming, the predominant way of manipulating objects is by copying. It turns out that copying is quite expensive in the programming world as well. To overcome this, traditional programmers introduce heavy use of pointers, which are cheap to copy, but very difficult to debug. Enter the swapping paradigm. The idea of swapping objects instead of copying them combines the best of both worlds — code written using the swapping paradigm is both efficient and easy to reason about. Not only that, it also supports modular reasoning, that is, the ability to reason about what a component does