Original Post
Hello! I'm using a vector to stock some MyClass class. However, MyClass contains a pointer. That caused a lot of bugs. I recently discovered it by outputting some text when destroying a MyClass object. Here's the problem: Vector[0] contains MyClass with pointer to 0x1111 When I add a MyClass with a pointer to 0x2222, std::vector copies the vector[0] and deletes the old one. But the destructor of myclass deletes the pointed object. So the copy now points to a deleted object. Is there a stl container that doesn't copy the items like so? std::list? I want my container to delete its object only when i'm done with it.