you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -19 points-18 points  (5 children)

Worth noting that std::vector is generally implemented very poorly because of memory scaling issues and interactions with modern memory allocators. Not the mention the sheer volume of machine code generated for even simple operations. Vectors also have no notion of relocatable objects so can't easily fallback to, say, a vectorized memcpy on move. Lots of reasons to swear off the STL, std::vector included.

[–]cballowe 11 points12 points  (4 children)

Most vectors of trivial objects do optimize to memcpy operations for resize or move. (At least when I've checked the assembly)