Consider an exception class with a copy constructor with side开发者_如何学运维-effects. Can a compiler skip calling the copy constructor here:
This question follows on from How to pass by lambda in C++0x?, but perhaps this is a clearer way to ask the question.
I\'m still a rookie programmer, I know that premature optimization is bad, but I also know that copying huge stuff around is bad, as well.
I am wondering if in C++0x \"12.8 C开发者_如何学Copying and Moving class objects [class.copy] paragraph 31\" when copy elision happens, exactly:
I was reading Want Speed? Pass by Value on the C++ Next blog and created this program to get a feel for copy elision and move semantics in C++0x: