They do the similar things.
What should be considered when choosing between the two?
Under which circumstances is either one preferred?
They do the similar things.
What should be considered when choosing between the two?
Under which circumstances is either one preferred?
I would prefer std::vector<std::unique_ptr<T>>
for several reasons:
boost::ptr_vector
, ptr_vector
is still implemented in terms of std::vector<void*>
.boost::ptr_vector
, but the support is clearer (and explicit) when using std::unique_ptr
.