Difference between smart pointer and raw pointer in c++