Hi!
I don't know how to assign my unique_ptr a new value.

std::unique_ptr<int> intPtr;

void changePointer(int* ptr)
{
    // I want intPtr to point to ptr
    // intPtr = ptr;
}

What should I do?

Thanks.

Recommended Answers

All 2 Replies

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.