Boost logo

Boost :

From: Edd Dawson (lists_at_[hidden])
Date: 2008-01-07 13:23:47

Hi Anthony,

Anthony Williams wrote:
> Edd Dawson <lists <at>> writes:
>> Currently one cannot create a thread_specific_ptr<void> as the return type of
>> thread_specific_ptr<void>::operator* would be void&.
> It might be worth adding a specialization of thread_specific_ptr to handle void
> data, but I don't think that traits would be the way to do it, as it adds lots
> of complexity for not much gain.
> However, this still begs the question: why?

Win32 Fibers is my specific use-case. They're represented by pointers-to-void.

I'm currently using thread_specific_ptr<int> with a little casting here or
there. It works fine, but it just feels a little dirty.

I don't know if you took a look at shared_ptr_traits<>, but the only trait in
there is "reference". It would be much simpler to do it this way than specialize
the entire class, IMO.

But I'm happy to go either way, if you think it's worth the effort.

Incidentally, I just noticed today that there's threads-specific list. Would
this best be discussed on there? If so, my apologies for the noise.


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