|
Boost : |
From: Mike Tegtmeyer (tegtmeye_at_[hidden])
Date: 2007-11-03 22:47:50
> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk