Ion GaztaƱaga wrote:
On the other hand, with the default_deleter it could be safe to convert (maybe if N >= M):
4) unique_ptr
-> unique_ptr
I don't support this conversion in shared_ptr and have no plans to. reinterpret_pointer_cast should work though.
A problem might occure if a user-provided deleter
is be convertible to deleter but it does not properly handle unknown-length arrays.
In general, if deleter<X> is convertible to deleter<Y> but does not handle Y
properly, it might cause problems. So I'm not sure that this case is
extraordinary in this sense.
It's true that these cases are a bit convoluted because, esp. in the
presence of a user-defined pointer type, we need to decide how much to trust
the deleter and how much to override whatever it says WRT conversions. For
instance, let's say unique_ptr