I need to better understand unique_ptr; allow me to pick your brain

This is a discussion on I need to better understand unique_ptr; allow me to pick your brain within the C++ Programming forums, part of the General Programming Boards category; I wrote some code that produces this:
Code:
1>c:\users\comp sci\documents\visual studio 2010\projects\predatorpreysimulation\predatorpreysimulation\world.h(25): error C2665: 'std::vector<_Ty>::vector' : none of the 7 ...

While you can use move-only objects (such as unique_ptr) in containers, some methods of the containers have more extensive requirements, i.e. they require the element type to be copyable and not just movable.

The (size_type n, E e) constructor of vector is one such. This should be fairly obvious: the constructor makes the vector n elements large and initializes each of these elements to be a copy of e. If E isn't copyable, that's not going to fly.

While you can use move-only objects (such as unique_ptr) in containers, some methods of the containers have more extensive requirements, i.e. they require the element type to be copyable and not just movable.

The (size_type n, E e) constructor of vector is one such. This should be fairly obvious: the constructor makes the vector n elements large and initializes each of these elements to be a copy of e. If E isn't copyable, that's not going to fly.

I actually already understood that ... the primary reason for my compile-time errors. My question was eliciting how to use a unique_ptr inside a container when every container has a copy constructor which violates unique_ptr no copy/no assignment?

I actually already understood that ... the primary reason for my compile-time errors. My question was eliciting how to use a unique_ptr inside a container when every container has a copy constructor which violates unique_ptr no copy/no assignment?

As long as you don't instantiate the container's copy constructor (i.e. never try to copy the container), that doesn't matter.