Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did you look at the generated assembly of your demo? RVO probably didn't happen there. "returns_a_foo" was most likely inlined into main and then there was no need of eliding a copy.

I'm not saying that you are wrong, only that your demo poorly demonstrates what you are arguing.



This is why I love HN.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: