raw pointer to unique_ptr

Hello,

Is it possible to convert a raw pointer to a unique_ptr?
If so how would I do that?

Thanks in advance
Hi,

Not sure about converting, but a unique_ptr can own a pointer, see option 2 of the constructor.

http://en.cppreference.com/w/cpp/memory/unique_ptr/unique_ptr
Topic archived. No new replies allowed.