use of std::default_delete for template-safe deletion

This commit is contained in:
Jack Andersen 2016-02-16 18:19:11 -10:00
parent 9008ab83c3
commit 8c659f9fb8
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ public:
return std::unique_ptr<TObjOwnerDerivedFromIObj<T>>
(new TObjOwnerDerivedFromIObj<T>(obj.release()));
}
~TObjOwnerDerivedFromIObj() {delete static_cast<T*>(m_objPtr);}
~TObjOwnerDerivedFromIObj() {std::default_delete<T>()(static_cast<T*>(m_objPtr));}
T* GetObj() {return static_cast<T*>(m_objPtr);}
};