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

Swap

  • Swaps two objects
  • Returns void

Exchange

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

You may also like...

Leave a Reply