I have a situation where in the library that I use, there are many functions that return the original pointers to objects, how can I now use raising smart pointers in my program, using this library and using smart pointers?
The library is xerces-C ++, and the example is a document iterator:
boost::shared_ptr<DOMNodeIterator> itera = document->createNodeIterator(rootelement, DOMNodeFilter::SHOW_ALL, NULL, true);
The function createNodeIteratorreturns a pointer to an object DOMNodeIterator, it is a raw pointer and therefore cannot be assigned exactly the same to boost::shared_ptr... How should I deal with this? Use raw pointers instead?
source
share