2 ms·
Why is C++ getting bashed ? The compiler didn't second guess anything here. If he coded as a newbie or programmer from another language without navel gazing too
by lenkite 6y ago
Why is C++ getting bashed ? The compiler didn't second guess anything here. If he coded as a newbie or programmer from another language without navel gazing too much, he wouldn't have run into this problem. He deliberately made his code more complicated and paid the price for it.
Many times straightforward code is the best code. Value returns in C++ are already optimised, no need to add anything fancy.