Re:Don’t blindly prefer emplace_back to push_back
by Yoric on Thursday March 04, 2021 @02:14PM
(#26346791)
Well, many languages try to keep this minimal.
C++ doesn't.
[ Parent
| on HN ]
Re:Don’t blindly prefer emplace_back to push_back
by ziml77 on Thursday March 04, 2021 @04:49PM
(#26348894)
And it's nothing new with move/copy semantics either. Even passing by reference is bad for hiding that. Every time I write C++ I'm tempted to take pointers as parameters in places where you'd normally take a reference just so the call site has an indication of what I'm doing.