
4 Nov
2007
4 Nov
'07
2:47 a.m.
You lost me there.
It's perfectly fine to delete a null pointer.
5.3.5/2 says
"if the value of the operand of delete is the null pointer the operation has no effect."
I am using delete in the general sense ie fclose, closedir, etc. And even though this doesn't directly map here, this also holds true for resources that been obtained with allocators; it is not perfectly fine to deallocate them if they are null(20.1.5) even though I would assert that a handle to resources obtained with std::allocator::allocate conform to a pointer concept. Mike