Can someone enlighten me in what is happening here?
int* stackint = new int(5);
{
std::unique_ptr<int> myInt(stackint);
*myInt = 8;
}
std::cout << *stackint; // 0
What exactly is happening here? I understand smart pointers when you construct them with new, or make_unique, what happens when you pass stack pointers to their constructor?