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

> This leads to structs being passed by value

do compilers generally optimize this away on -O3, or do you just accept the performance hit in exchange for prettier code?



If it's a static method (or in an anonymous namespace in C++), it should get fixed at any optimisation level. However if it's a global method, you'll need to pass -flto to defer optimisations to link time to make it work.




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

Search: