smart pointers manual

Dec 21, 2015 at 4:28pm
smart pointers are nothing if i can do perfect manual deallocation,move semantics, and proper handing over a pointers right?

in that case its okay to use naked pointers?
Last edited on Dec 21, 2015 at 4:37pm
Dec 21, 2015 at 5:05pm
They work. But the entire point is that smart pointers do it for you, and in doing so, clean up your code and avoid the inevitable mistakes that will be made. In C++11 and even more so in C++14, owning pointers are almost always just worse.
Dec 21, 2015 at 5:32pm
if i can do perfect manual deallocation,move semantics, and proper handing
If you can do that in a non-trivial project, then you are truly gifted. Smart pointers will be there for the rest of us.
Dec 21, 2015 at 5:44pm
One of the major benefits of using smart pointers is that they make code easier to reason about. You lose that benefit if you manually manage memory, even if you do so perfectly.
Dec 21, 2015 at 5:59pm
thanks guys

okay, i see i have another side of curiousness but this answers it and my post.
Last edited on Dec 21, 2015 at 5:59pm
Topic archived. No new replies allowed.