
3 Aug
2005
3 Aug
'05
6:42 p.m.
I have a weak_ptr that might be empty. If not empty, I'd like to make a smart pointer from it. But the code below throws in the shared_ptr constructor, and I don't see how to test whether a weak_ptr is empty. boost::weak_ptr<int> wp; boost::shared_ptr<int> sp(wp); if ( sp.get() ) { ... } Suggestions?