Am 15.05.2015 um 17:51 schrieb Jean-Marc Lasgouttes <lasgout...@lyx.org>:
> Le 15/05/2015 16:58, Stephan Witt a écrit : >>> Yes, I think that it is better passing big objects by reference rather >>> than by value. >> >> But this is not a good property of C++ compilers than. >> 1. It's not a constant fact if an object is big. >> 2. The compiler should generate fast code for this scenario too. >> 3. This results in hard to read code eventually. > > C++ rvalue references fix this problem, and they re implemented in Qt5 (and > partly in Qt4.8 AFAICS). Can you give an example, please? And what's with return value optimization? I'm not sure I understood it completely, but it sounds like returning objects by value isn't a problem with modern compilers anymore. Especially I'm not sure if this is true for nested function calls and passing the result more than one call up. Stephan