Hey, > You need to give libkleo a full get rid of boost shared_ptr to get things to > work. It should just be an advanced search/replace job. And this is abi- > changing. > > I saw this: > +template<typename T> std::shared_ptr<T> > make_shared_ptr(boost::shared_ptr<T>& ptr) > +{ > + return std::shared_ptr<T>(ptr.get(), [ptr](T*) mutable > {ptr.reset();}); > +} > > and I got quite worried. I at least need to read up a bit on how exactly a > reference is captured into a lambda to say if it is quite good, or > incredibly dangerous. Is it captured by reference or by copy ? The latter > is good. the first is quite bad.
I copied this snipset from stackoverflow: http://stackoverflow.com/questions/12314967/cohabitation-of-boostshared-ptr-and-stdshared-ptr#comment28669000_12315035 So far thsi version works, if there are no weak_ptrs created for the new created shared_ptr. Best Regards, sandro
signature.asc
Description: This is a digitally signed message part.