
6 Nov
2007
6 Nov
'07
11:47 a.m.
I think the obvious rationale is that while both approaches have their merits, you can indeed implement the one based on the other but not vice versa. I agree. I have worked with various APIs which use integer types as handles and use -1 as the null state. If shared_ptr automatically ignored handles that compare equal to 0, it wouldn't be usable with these APIs. I also don't think that it's unreasonable, or even necessary to justify, that custom deleters should behave like delete/free.