title: In c++11, does returning a std::string in a function move or copy it?
body: <p>suppose I have the following code.</p>
  
  <pre><code>std::string foo() {
      std::string mystr("SOMELONGVALUE");
      return mystr;
  }
  
  int main() {
      std::string result = foo();
  }
  </code></pre>
  
  <p>When I call 'foo', is the data in <code>mystr</code> copied or moved into <code>result</code>? I believe that it is moved C++11 style, but I was hoping for clarification and/or links to show that.</p>
  
  <p>Thanks! </p>
  
  <p>Edit: I suppose I want to know the answer to this question when compiling with g++ for c++11 or later.</p>