Originally Posted by
ccafe
I've found several container classes out there that use malloc() internally as their allocator, and realloc() for growing/shrinking. Of course, they use placement new.
They claim the only requirement is that these container classes cannot be used for objects "whose copy constructor has side effects". Is that always the case? I mean, is having a "copy constructor without side effects" the only requirement for being it safe to reallocate C++ objects to a different memory address?
I make this question because one of the first things I learnt about C++ is that objects are not supposed to move from one memory address to another, so I'm wondering if this kind of container classes violate some rule from the standard.