I came to know that smart pointer is used for resource management and supports RAII.
But what are the corner cases in which smart pointer doesn\'t seem smart and things
Many people run into problems when using smart pointers mixed with raw pointers (to the same objects). A typical example is when interacting with an API that uses raw pointers.
For example; in boost::shared_ptr
there is a .get()
function that returns the raw pointer. Good functionality if used with care, but many people seem to trip on it.
IMHO it's an example of a "leaky abstraction".