Anytime you want to write new [..] just for allocate dynamicarray, using a vector or string instead, and using reserve() toallocate enough space.
Copy in and copy out can cause efficient problem. Furthermore, It brings
another problem. when you inserting a derived class object into a container
of base class objects is always error(slicing error). In order to fight this
problem, you can use container of pointer. But it will cause resource leaking
problem if you forget or an exception is thrown. So a better choice is
use smart pointer. But don’t use auto_ptr in any container, It’s
prohibited in c++, and produce a compiler error, see effective stl item
8.
All container is not thread-safe. It’s your duty to make thread-safe, and
thread-safe is OS depended. Detail can be seen effective STL item 12