Most voted "smart-pointer" questions
6 questions
Sort by count of
-
10
votes3
answers540
viewsWhat kind of smart pointer to choose?
How to know what kind of smart pointer to use? And what’s the difference between them? Example: std::unique_ptr<MinhaClasse> mClasse(new MinhaClasse) std::shared_ptr<MinhaClasse>…
-
6
votes1
answer169
viewsIntelligent Pointers
I was studying smart pointers and based on this blog: https://murilo.wordpress.com/2008/12/15/smart-pointers-os-ponteiros-espertos-do-c/ #include <iostream> template <class T> class…
-
5
votes1
answer459
viewsWhat is a shared_ptr?
If possible, with an example of code, as this is missing in the reference to really understand when and how to use the shared_ptr.
-
4
votes1
answer74
viewsWhat is Clone-on-write (Cow)?
I’m studying Rust and recently discovered the existence of Cow, one smart-Pointer that works to make Clone-on-write. The description of the page seemed confusing to me, since I don’t have much…
-
2
votes1
answer70
viewsDoubt about C++ pointers
Why if a char type raw pointer is pointing to some character of a std::string and print this pointer without the asterisk (*) it will show the rest of the string from the character it is pointing…
-
0
votes1
answer134
viewsC++ smart pointers and functions
I am reading an article on msdn about smart pointers. In the article there is this example: class LargeObject { public: void DoSomething(){} }; void ProcessLargeObject(const LargeObject& lo){}…