Boost logo

Boost :

From: William Kempf (williamkempf_at_[hidden])
Date: 2001-08-30 13:47:39

From: "Greg Colvin" <gcolvin_at_[hidden]>
>From: William Kempf <williamkempf_at_[hidden]>
>>From: "Peter Dimov" <pdimov_at_[hidden]>
>> >The reference section doesn't mention that thread_specific_ptr calls
>> >'delete' on the contained pointer on thread exit, though. Only on
>>Where, within the reference, could I mention this? None of the methods
>>exposed in the interface deal with this event. The fact that reset()
>>requires a pointer to an object created through "new" is a strong
>>but I understand that this doesn't fully cover things. I can add the text
>>in reset() indicating that the object is deleted on thread termination,
>>I modeled this off the documentation for std::auto_ptr where they don't
>>mention of deletion when the object is destroyed.
> ~auto_ptr() throw();
> Requires:
> The expression delete get() is well formed.
> Effects:
> delete get().

Yes, but the problem is that thread_specific_ptr deletes the object when the
thread terminates, not when the thread_specific_ptr is destroyed. With
auto_ptr the "event" that destroyes the contained object is a direct
interface detail and is easily documented. With thread_specific_ptr the
"event" is not an interface detail at all and other than documenting it the
way I have (in the introduction explicitly and implied in the description of
reset()) I don't know how to clarify things better. I agree that it should
be clarified better, I'm just nos sure how :).

Bill Kempf

Get your FREE download of MSN Explorer at

Boost list run by bdawes at, gregod at, cpdaniel at, john at