自动析构时是先析构后构造的. //普通(非模板)类的成员模板 class DebugDelete{ public: DebugDelete(ostream &s = cerr) :os(s){} template void operator()(T*p)const { os << "deleting unique_ptr " <<typeid(T).name() <<endl; delete p; } private: ostream &os; }; void demo_general_class_tempalte_mem