Re:The Sad Truth About C++ Copy Elision
by nly on Saturday April 03, 2021 @12:57PM
(#26682618)
Having a temporary variable to make code more readable is hardly a 'clever thing'
[ Parent
| on HN ]
Re:The Sad Truth About C++ Copy Elision
by AlexanderDhoore on Saturday April 03, 2021 @01:12PM
(#26682757)
Maybe not in a sane language. But apparently it is in C++.
> Having a temporary variable to make code more readable is hardly a 'clever thing'
Right, but if you're sprinkling your code with temp variables, specially with a language such as C++ where copy elision is far from ensured, then you're already not averse to the idea of instantiating variables left and right.