I'm a little confused by the fact that I can't do something like the following:
Code:
int x = 3;
std::unique_ptr<int> px = &3;
// or even more to the point
std::unique_ptr<int> px = new int(3);
the compiler complains that it can't convert int* to std::unique_ptr<int>. fair enough. however, when I derive a class from unique_ptr, and define an assignment operator to take a right-hand argument of pointer type, it continues to give me the same type of error. I'm just curious as to why the pointer is treated differently.