Top "Unique-ptr" questions

std::unique_ptr is a smart pointer that retains sole ownership of an object through a pointer.

How can I pass std::unique_ptr into a function

How can I pass a std::unique_ptr into a function? Lets say I have the following class: class A { …

c++ c++11 unique-ptr
Copy constructor for a class with unique_ptr

How do I implement a copy constructor for a class that has a unique_ptr member variable? I am only …

c++ c++11 unique-ptr
Proper way to create unique_ptr that holds an allocated array

What is the proper way to create an unique_ptr that holds an array that is allocated on the free …

c++ linux gcc c++11 unique-ptr
Does unique_ptr::release() call the destructor?

Is this code correct? auto v = make_unique<int>(12); v.release(); // is this possible? Is it equivalent to …

c++ unique-ptr
make_unique and perfect forwarding

Why is there no std::make_unique function template in the standard C++11 library? I find std::unique_ptr<…

c++ c++11 variadic-templates unique-ptr perfect-forwarding
C++ std::unique_ptr return from function and test for null

I have a function that needs to return a pointer to an object of class myClass. For this purpose I´…

c++ c++11 unique-ptr
Does C++11 unique_ptr and shared_ptr able to convert to each other's type?

Does C++11 standard library provide any utility to convert from a std::shared_ptr to std::unique_ptr, or vice …

c++ c++11 shared-ptr unique-ptr
unique_ptr to a derived class as an argument to a function that takes a unique_ptr to a base class

I'm trying to use a unique_ptr to derived class in a function that takes a unique_ptr to a …

c++ visual-studio-2012 c++11 unique-ptr
std::auto_ptr to std::unique_ptr

With the new standard coming (and parts already available in some compilers), the new type std::unique_ptr is supposed …

c++ c++11 smart-pointers auto-ptr unique-ptr
C++ inserting unique_ptr in map

I have a C++ object of type ObjectArray typedef map<int64_t, std::unique_ptr<Class1>> …

c++ pointers map stl unique-ptr