[webkit-dev] Get rid of RefPtr, replace with std::optional<Ref>?

Maciej Stachowiak mjs at apple.com
Fri Sep 1 10:46:16 PDT 2017



> On Sep 1, 2017, at 10:07 AM, Brady Eidson <beidson at apple.com> wrote:
> 
> 
> 
>> On Sep 1, 2017, at 9:46 AM, Maciej Stachowiak <mjs at apple.com> wrote:
>>> 
>>> Does RefPtr do anything for us today that std::optional<Ref> doesn’t?
>> 
>> The obvious things would be: uses less storage space
> 
> Grumble. If that’s true (which, thinking about it, of course it is true) this is pretty much a nonstarter. So… nevermind.

It might be possible to make a specialization of std::optional<Ref> that avoids the overhead for a separate initialized bool. I'm not sure if it is wise to write specializations of standard library template classes though.

Regards,
Maciej




More information about the webkit-dev mailing list