smart pointers是隐式raii 《c.plus.plus.coding.standards.101.rules.guidelines.and.best.practices》 chapter 13 ensure resources are owned by objects. use explicit raii and smart pointers
summary don 't saw by hand when you have power tools: c++ 's "resource acquisition is initialization " (raii) idiom is the power tool for correct resource handling. raii allows the compiler to provide strong and automated guarantees that in other languages require fragile hand-coded idioms. when allocating a raw resource, immediately pass it to an owning object. never allocate more than one resource in a single statement.