Every time you insert a pair in a std::map whose key is a std::string, it makes two copies. You can avoid using raw pointers but it is exception-unsafe. Is there some way to use a smart pointer instea
Are there a开发者_如何学Cnything along the lines of C++ smart pointers in Java?All of Java\'s \'pointers\' (references) are Smart Pointers.
Occasionally, for fleeting moments, I think auto_ptr is cool.But most of the time I recognize that there are much simpler techniques that make it irrelevant.For example, if I want to have an object fr
So as part of a large hobby learning project I have implemented a mostly complete smart pointer implementation.It does practically every thing I ask of it, except for one minor detail that may prove t
It is often quite confusing to C++ newcomers that const member functions are allowed to call non-const methods on objects referenced by the class (either by pointer or reference). For example, the fol
I am getting run time crash in the following piece of code and not able to debug also. Please review and let me know what\'s going on.
I\'m wondering if anyone\'s run across anything that exists which would fill this need. Object A contains an object B.It wants to provide access to that B to clients through a pointer (maybe there\'s
I saw the following code, #include <new> #include <memory> using namespace std; class Fred;// Forward declaration
For example: shared_ptr<const shared_ptr<const int> > pp; is fairly intimidating... wh开发者_运维问答ereas
I have a project and I want make smart pointers usage better. The main idea is to use them when returning new object from function. The question is what smart pointer to use? auto_ptr or shared_ptr f