6 ms·
> and yet you still have to multiply the size of the container by the size of the data type inside the container in order to have correct behaviour. I'm also w
by jstimpfle 5y ago
> and yet you still have to multiply the size of the container by the size of the data type inside the container in order to have correct behaviour.
I'm also wondering what is the correct behaviour? In C++ you very very rarely want the size in bytes of a thing (much less often than in C), especially when implementing a generic container.
In C++, every contained element could be a complex type with copy and move semantics and what not, so you should not just deal with plain memory.