
5 Apr
2009
5 Apr
'09
2:50 p.m.
Michael Howell wrote:
The attached patch add reference counting "implicit sharing" to Boost.Any. It is my first patch to Boost, so it will probably need some changes.
This code is not thread-safe. Just use shared_ptr. Also, any is a value type. We do not want it to have reference semantics. So you'd need to use COW. The thing about COW is that it is only useful if you copy when you don't need it. But why copy in the first place if you don't need it? Hence this is fairly useless, especially since we're getting move semantics soon.