<p>Why is it wrong to use <code>std::auto_ptr&lt;&gt;</code> with standard containers?</p>

The
copy semantics
of
```
auto_ptr
```
are not compatible with the containers.
Specifically, copying one
```
auto_ptr
```
to another does not create two equal objects since one has lost its ownership of the pointer.
More specifically, copying an
```
auto_ptr
```
causes one of the copies to let go of the pointer. Which of these remains in the container is not defined. Therefore, you can randomly lose access to pointers if you store
```
auto_ptrs
```
in the containers.