
7 Mar
2009
7 Mar
'09
10:54 p.m.
On Saturday 07 March 2009, Peter Dimov wrote:
Another possible solution is to stick the "weak this" into a thread-local static member of enable_shared_from_this<Y>. This also works but (absent compiler support for thread locals) doesn't fit into the header-only nature of shared_ptr.
It could be added as a extra feature that only exists for compilers with support for thread local variables (or when threading is disabled). And since thread_local is in c++0x, it's no barrier for the feature being added at some point to std::enable_shared_from_this.