~cpp #include <iostream> using namespace std; template <typename T> inline void SAFE_DELETE(T*& arg) { if(arg) { delete arg; arg = NULL; } } int main() { int* i = new int(5); SAFE_DELETE(i); SAFE_DELETE(i); SAFE_DELETE(i); SAFE_DELETE(i); return 0; }