Top "Smart-pointers" questions

An abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking

Does C++11 have wrappers for dynamically-allocated arrays like Boost's scoped_array?

I often need to deal with dynamically-allocated arrays in C++, and hence rely on Boost for scoped_array, shared_array, …

c++11 memory-management boost wrapper smart-pointers
Simple reference counting: smart pointers

I would like to implement a simple reference counting using smart pointers. The variable pointer represents pointer to stored object, …

c++ templates smart-pointers reference-counting
How to break shared_ptr cyclic reference using weak_ptr

I have read that weak_pointers can be used to break cyclic references. Consider the following example of a cyclic …

c++ smart-pointers c++03
How can I create a smart pointer that locks and unlocks a mutex?

I have a threaded class from which I would like to occasionally acquire a pointer an instance variable. I would …

c++ thread-safety mutex smart-pointers raii
What is diffrence between lock() and expired()? weak_ptr C++

Recently I started at C++11. I studied about weak_ptr. There exist two ways of getting raw pointer. lock() function …

c++ c++11 shared-ptr smart-pointers weak-ptr
Deleting vector of pointers

I need to create pointers of instances of a class, and the program do not know at compilation time how …

c++ pointers vector smart-pointers delete-operator
pros and cons of smart pointers

I came to know that smart pointer is used for resource management and supports RAII. But what are the corner …

c++ smart-pointers
What is the difference between std::shared_ptr and std::experimental::atomic_shared_ptr?

I read the following article by Antony Williams and as I understood in addition to the atomic shared count in …

c++ c++11 concurrency atomic smart-pointers
What is the difference between auto pointers and shared pointers in C++

I have heard that auto pointers own their object whereas shared pointers can have many objects pointing to them. Why …

c++ shared-ptr smart-pointers auto-ptr
What is the use of CComPtr over CComQIPtr in COM?

Can any one explain, What is the use of CComPtr over CComQIPtr in COM? CComPtr<ISampleInterface> Sample1; CComQIPtr&…

visual-c++ com atl smart-pointers