3 ms·
> 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 prett
by voldacar 7y ago
> 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?
- asymptotically2 7y agoIf 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.