Re:Don’t blindly prefer emplace_back to push_back
by IshKebab on Thursday March 04, 2021 @05:00AM
(#26340605)
Yeah but the title sounds like "you shouldn't just always use emplace_back instead of push_back" but the actual content is "you shouldn't use emplace_back completely incorrectly because you don't know what it is".
The only actual argument against blindly using emplace_back everywhere is that it has worse compile time in a deliberately pathological microbenchmark. Not convincing, though it is interesting.
The only actual argument against blindly using emplace_back everywhere is that it has worse compile time in a deliberately pathological microbenchmark. Not convincing, though it is interesting.