basics/initmove.hpp

The following code example is taken from the book
C++ Move Semantics - The Complete Guide by Nicolai M. Josuttis, Leanpub, 2020
The code is licensed under a Creative Commons Attribution 4.0 International License. Creative Commons License

// raw code

#include <string>

class Person {
private:
  std::string first;  // first name
  std::string last;   // last name
public:
  Person(std::string f, std::string l)
   : first{std::move(f)}, last{std::move(l)} {
  }
  //...
};