[webkit-dev] Get rid of RefPtr, replace with std::optional<Ref>?
fpizlo at apple.com
Fri Sep 1 10:08:38 PDT 2017
> On Sep 1, 2017, at 9:30 AM, Brady Eidson <beidson at apple.com> wrote:
> I recently worked on a patch where - because of the organic refactoring of the patch over its development - I ended up with a std::optional<Ref> instead of a RefPtr.
> A followup review after it had already landed pointed this out, and it got me to thinking:
> Does RefPtr do anything for us today that std::optional<Ref> doesn’t?
> I kind of like the idea of replacing RefPtr with std::optional<Ref>. It makes it explicitly clear what object is actually holding the reference, and completely removes some of the confusion of “when should I use Ref vs RefPtr?”
There are many places in JSC where we don’t even consider using Ref.
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev