Is there other technique like RVO (return value optimization) or NRVO (named return value optimization) that can be use with VC2008?
+3
A:
I wouldn't worry too much about those optimisations if I were you. Apart from anything else, they are not portable.
If you are worried about writing efficient C++ code, the number one rule is to avoid copying altogether. Make sure you use reference in all places where they are possible, but don't try to use them where they are not. After, all sometimes you actually need a new value - as the return value for implementations of operator+(), for example.
anon
2009-05-17 14:38:17
More Effective C++ has an item on RVO ..so thought it would be good to know these things
yesraaj
2009-05-17 16:46:09