
3 Mar
2008
3 Mar
'08
6:01 p.m.
Yes, and I see nothing bad with it. Shared_ptr does precisely the same, and since this cleanup function is intended to do the same as shared_ptr's deleter does, I don't see why would the interface have to differ.
thread_specific_ptr was more or less intended to provide a C++ equivalent to pthread_setspecific, and the POSIX interface associates a single destructor function to a TSD slot. It's technically possible to emulate shared_ptr, but is there a reason for that?