<javascript:>.
<javascript:>.
> >
> > > Visit this group at
> >
https://groups.google.com/a/isocpp.org/group/std-discussion/.
> >
> > I don't know whether this is intended but it seems like this another one
> > of those unfortunate results (don't know how else to call it). If you pass
> > in a temporary std::shared_ptr it is possibly valid, so I don't think we
> > should restrict to_address. You might have other custom smart pointers
> > where it's also valid.
> >
> > It's like std::string_view: `std::string_view a = get_str();` (where
> > get_str() returns std::string) should really be ill-formed, but then you
> > can't do this (`foo` takes a std::string_view): `foo(get_str());`, which is
> > perfectly valid. :(
> >
>
>
> Isn't shared have same problem as unique? You can have last shared pointer
> as value, and then it will deallocate when expression ends. Even if it was
> not last, you have no guarantees that someone else will delete this pointer
> at any time.
That's why I said "possibly". You're right of course :)