I am using C++.C++0x using Visual Studio 2010 to be correct. Suppose I have a class Z.To make it safer in my application to work with pointers to this class, I can consistently use smart pointers (sh
In C++0x (n3126), smart pointers can be compared, both relationally and for equality. However, the way this is done seems inconsistent to me.
When I have a class that contains pointers as member va开发者_Python百科riables what type of smart pointer should they have if I want don\'t want to use plain pointers? They do not need to be shared (
Mr. Lidström and I had an argument :) Mr. Lidström\'s claim is that a construct shared_ptr<Base> p(new Derived); doesn\'t require Base to have a virtual destructor:
I have a C++ application which makes extensively use of pointers to maintain quite complex data structures.The application performs mathematical simulations on huge data sets (which could take several
If yo开发者_如何学运维u have to pass objects across threads which smart pointer type is best to use?
If my class SomeType has a method that returns a element from the map (using the key) say std::unique_ptr<OtherType> get_othertype(std::string name)
I\'m used to the C++ RAII facilities, and I want to use RAII the right way with managed code in C++/CLI. Herb Sutter and Microsoft both tell me this is the best practice.
I have some original code that manages exception safety like this: void foo() { HDC hdc = //get an HDC HBITMAP hbitmap = //get an HBITMAP
Imagine I create an instance of Foo on the heap in a method/function and pass it to the caller. What kind of smartpointer would I use?