As far as I know, it's preferred to use a smart pointer instead of managing the lifetime of a dynamically allocated object through a raw pointer,
e.g.: MyObject* obj = new Object();
But in some frameworks/libraries they always return/work with raw pointers instead of smart pointers, (maybe they have their own GC objects? I don't know).
It's also easier to work with
MyObject* obj = GetAObject(); // return raw owning pointer
than
SharedPointer<MyObject> obj = GetAObject(); // return smart pointer
Should one always use smart pointers instead of manual new
/delete
(like in the example above) or are there any cases where raw resource-owning pointers should be used?