Top "Unique-ptr" questions

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

How to debug C++11 code with unique_ptr in DDD (or gdb)?

std::unique_ptr are nice, but I find them less comfortable when debugging in DDD or gdb. I'm using the …

c++ c++11 gdb unique-ptr ddd-debugger
When to use boost::optional and when to use std::unique_ptr in cases when you want to implement a function that can return "nothing"?

From what I understand there are 2* ways you can implement a function that sometimes doesnt return a result(for example …

c++ boost c++11 unique-ptr boost-optional
Copying std::unique_ptr's value via dereferencing

I wrote the following code where I try to copy the value of unique_ptr object into a structure. #include &…

c++ c++11 unique-ptr visual-c++-2012
Is unique_ptr guaranteed to store nullptr after move?

Is unique_ptr guaranteed to store nullptr after move? std::unique_ptr<int> p1{new int{23}}; std::unique_…

c++ c++11 move-semantics unique-ptr
How does returning std::make_unique<SubClass> work?

I have a base class and its subclass: class Base { public: virtual void hi() { cout << "hi" << …

c++ move unique-ptr