31 Jan
2016
31 Jan
'16
3:12 a.m.
On Sat, Jan 30, 2016 at 2:20 AM, Rob Stewart
On January 29, 2016 3:35:54 PM EST, Emil Dotchevski < emildotchevski@gmail.com> wrote:
The point of null deleter is specifically to be able to use shared_ptr in cases when it isn't possible for shared_ptr to control the lifetime of the object. I don't think of the lack of safety as a disadvantage, it's a feature.
I wouldn't go that far, but you're right that it's an example of "trust the programmer."
OK, don't go that far :) but regardless, we've deduced that my example shows proper use of null_deleter, in fact there is no other use case for null_deleter except to do just this, given that we're in agreement that its use with global objects is not safer than its use with local objects. Emil