`swap` uses `move` to enable swapping objects that can only be moved but not copied (e.g., std::unique_ptr&lt;T&gt;). Note that this swap implementation is meant to be generic---types may implement their own specific `swap` that performs no copies or moves whatsoever. Example:<p><pre><code>  namespace NS {
    struct S {
      friend void swap(S&amp; a, S&amp; b) {
        &#x2F;&#x2F; do something interesting here
      }
    };
  }

  &#x2F;&#x2F; later..
  template&lt;typename T&gt;
  void f(T&amp; a, T&amp; b) {
    using std::swap;
    swap(a, b); &#x2F;&#x2F; calls NS::swap(a, b) if T = NS::S
  }</code></pre>