3 ms·
vector::emplace() still needs to construct the object, it just happens inplace and avoids a redundant copy of an already constructed object. Same with std::move
by flohofwoe 7y ago
vector::emplace() still needs to construct the object, it just happens inplace and avoids a redundant copy of an already constructed object. Same with std::move(). As such the blog post is correct.
Using POD structs which can be zero-initialized and memcpy'ed may indeed be faster, especially when these are bulk-operations.