[Followup to this question]
I\'ve been dealing a little bit with smart pointers to c-style arrays recently. I ultimately wound up doing the recommended thing and usi
Yes, your example is valid for the very reasons you've stated. unique_ptr::pointer is int *, and you're trying to pass ownership of that to a shared_ptr, so the converting constructor you've listed will participate in overload resolution, and will make a copy of the deleter (std::default_delete) because it's not a reference type.
So the following is valid, and will call delete[] when the shared_ptr reference count goes to zero
std::shared_ptr mySharedArray = std::make_unique(16);
Another way to write this, other than the lambda you've shown, is
std::shared_ptr mySharedArray(new T[16], std::default_delete());
which will result in mySharedArray acquiring the same deleter as the previous line.