3 ms·
No, C has much less RVO allowed than C++. I provided an example of this here the last time : https://news.ycombinator.com/item?id=17216250 https://news.ycombina
by jcelerier 8y ago
No, C has much less RVO allowed than C++. I provided an example of this here the last time : https://news.ycombinator.com/item?id=17216250 https://news.ycombinator.com/item?id=17216250
- stephencanon 8y agoFrom what I can see, the example you list there is just a missed optimization in the C compilers you tested. It's absolutely allowed, and clang trunk is happy to do it in C-mode, for example.
- petters 8y agoThere could be some more fundamental differences due to the requirement that different objects require different pointers that prevent some optimizations.