On 5/4/2013 5:36 PM, Daniel Frey wrote:
On 04.05.2013, at 21:45, Michael Marcin
wrote: Here is another data point: http://ideone.com/GgaZZV
And here are msvc11 results: http://codepad.org/XFT5qVyE
based on: http://stackoverflow.com/questions/1693005/copy-elision-on-visual-c-2010-bet...
From what I can see these are some more basic tests and they confirm that copy elision does not take place for pass-by-value (for MSVC, but my tests also confirmed that for GCC/Clang), i.e., the last test case "identity( rvalue() )" does not eliminate the temporary. Is there anything else that can be learned from the above that I missed?
MSVC11 does do copy elision when only trivial types are involved it
seems. For example try instead of std::vector try:
typedef std::array