Questions tagged as 'smart-pointer'

1
answer

Smart Pointers

I was studying smart pointers and based on this blog: link #include <iostream> template <class T> class SmartPointer { T *ptr; public: SmartPointer(T *p):ptr(p) {} ~SmartPointer() {delete ptr;}...
asked by 03.12.2017 / 10:44
1
answer

What is a shared_ptr?

If possible, with a code example, as this is missing from the reference to really understand when and how to use shared_ptr .     
asked by 16.02.2016 / 17:23
1
answer

C ++ smart pointers and functions

I'm reading an article in msdn about smart pointers. In the article there is this example: class LargeObject { public: void DoSomething(){} }; void ProcessLargeObject(const LargeObject& lo){} void SmartPointerDemo() { // Creat...
asked by 21.03.2016 / 19:01