27 Aug
2005
27 Aug
'05
2:22 p.m.
Hi, I was wondering why e.g. boost:shared_ptr has an explicit constructor. This makes automatic conversion from T* to shared_ptr<T> impossible. The lack of the opposite conversion is covered by the FAQ and reasonable; however, I couldn't think of a good reason why I shouldn't be able to do something like this: std::set< boost::shared_ptr<Foo> > coll; coll.insert(new Foo); // error: No implicit conversion from Foo* to shared_ptr<Foo> Best regards, Matthias