It seems to me that the reset method in boost scroll_ptr and shared_ptr leads to an incorrect order of construction and destruction:
boost::scoped_ptr<Component> component(GetDefaultComponent());
component.reset(new BetterComponent);
This is the wrong IMO order.
You can first call the reset method with no arguments, and then set a new pointer. However, this seems like a workaround for me. (And this “workaround” means that something is wrong.)
I am convinced that activists are very smart. Thus, there should be a rationale for the current approach.
Does anyone know more?
source
share