#include <cstdlib>

#include <iostream>
#include <string>

std::string ReturnString(void) {
  std::string x("World");
  return x;  // this return might copy (depends on compiler optimizing move or copy)
}

// Example of traditional copy by value semantics. You are just copying a
// string over when you need one.
int main(int argc, char **argv) {
  std::string a("Hello");
  std::string b(a);  // copies a to b

  // Copy return value into b.
  b = ReturnString();

  return EXIT_SUCCESS;
}