- C++相談室 part118 [転載禁止]©2ch.net
859 :デフォルトの名無しさん[]:2015/08/24(月) 15:40:34.39 ID:1RhzDVi9 - template <typename T>
void try_delete(T* ptr) { if(std::has_virtual_destructor<T>::value) delete ptr; else throw std::logic_error((__FILE__ + std::to_string(__LINE__) + typeid(T).name()).c_str()); }
|