Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 3
    Well, that's even stated in question. The real question is why a std::move() is necessary here. Commented Feb 25, 2014 at 15:15
  • Sorry. Totally missed that. Oh well. (But hey, it still works in VS2013! Hurray! :-P ) Commented Feb 25, 2014 at 15:22
  • @pepper_chico But the accepted answer says it is conformant! Commented Feb 25, 2014 at 16:30
  • @aldo the accepted answer says the OP compiler error report is correct behavior, which means, the OP's code is not conformant to standard. what you're saying, it seems, is that allowing the return without errors is right, which currently is not. It's not clear whether you're saying VS2013 is compiling the OP's code or not, it looks like you're Harraying! because it it's. Commented Feb 25, 2014 at 16:40
  • @pepper_chico I edited my answer to contain code comments emphasizing that I had added the std::move calls (as suggested by the OP) which make the code standard-compliant (which - surprise! - compiles with no error). Commented Feb 25, 2014 at 19:47