Some container operations, such as std::vector
's constructor
vector(size_type n, const T& value, const Allocator& = Allocator());
or std::vector::resize
, require that T
be CopyInsertable
. This requires that the vector be able to call T
's copy constructor. So you could not construct an std::vector<boost::scoped_ptr<U>>
using this constructor.
Before C++11, the requirements on T
were more strict. Since the latest standard, the requirements are tailored to each container operation, rather than the container as a whole. So there are probably many situations in which you could use a vector of boost::scoped_ptrs
.