Why does it look like boost::shared_ptr constructions are getting slower?
问题 I have a problem with boost shared_ptr. The initialization time of the smart pointer in the cycle is increased after the first iteration. The first iteration takes 40 msec. Every other iteration takes about 400 msec. I have no idea why it happens. I checked and there are no memory leaks and all destructors are called. Does anyone have a solution of this case? PS. However, when I use the boost::ptr_vector, the time is not increased( but only in debug version :) ). See example: class A; typedef