It isn't clear to me what the benefits are.
If I have:
Foo* foo = nullptr;
std::unique_ptr<Foo> unique_foo(foo);
Is the nullptr_t constructor called in that situation? Or only if you do:
std::unique_ptr<Foo> unique_foo(nullptr);
Thanks!
There is some discussion here which is to allow you to passing in nullptr_t, otherwise it won't compile since it won't cast to type pointer. So my question may be why it doesn't cast?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With