I know the title sounds familiar as there are many similar questions, but I\'m asking for a different aspect of the problem (I know the difference between having things on t
I'm sure a C++ expert will come along with a better answer, but personally I like the second approach. Using smart pointers helps with the problem of forgetting to delete
and as you say, it looks cleaner than having to create an object before hand (and still having to delete it if you want to allocate it on the heap).