Most likely, the cost comes from the atomic decrement of the link account, which is quite expensive compared, for example, with whole assignments, and can entail a cache (or be very extreme, page) skipping / error and be atomic op, it can also carry such things like cache line invalidation.
However, destroying a raw pointer is non-op, so I'm not quite sure what you expect from weak_ptr, but it is physically impossible for it to offer the same cost of destruction if it offers any kind of destruction semantics.
Equally, it is more than possible that you are not using them. Forced signs are not a silver mark - you still have to think about who owns the property. The widespread use of a weak pointer tells me that you really haven't thought through your property semantics.
Finally, there is an implementation of shared_ptr and weak_ptr in MSVC 2008 in the std :: tr1 namespace. You can try this.
Puppy
source share