Swap (C++11) vs Exchange (C++14)

code

Swap

  • Swaps two objects
  • Returns void

Exchange

  • Swaps (moves) two objects
  • Returns the old value

Leave a comment

Your email address will not be published.