Using memcpy in the STL

Posted by wowus on Stack Overflow See other posts from Stack Overflow or by wowus
Published on 2010-06-08T23:44:00Z Indexed on 2010/06/08 23:52 UTC
Read the original article Hit count: 327

Filed under:
|

Why does C++'s vector class call copy constructors? Why doesn't it just memcpy the underlying data? Wouldn't that be a lot faster, and remove half of the need for move semantics?

I can't imagine a use case where this would be worse, but then again, maybe it's just because I'm being quite unimaginative.

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl