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

2017-09-01 Thread JF Bastien
The standard wants you to specialize things in std sometimes, and not other times... I’m not sure here’s clear guidance here. :( On Fri, Sep 1, 2017 at 10:46 AM Maciej Stachowiak wrote: > > > > On Sep 1, 2017, at 10:07 AM, Brady Eidson wrote: > > > > > > > >> On Sep 1, 2017, at 9:46 AM, Maciej

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

2017-09-01 Thread Maciej Stachowiak
> On Sep 1, 2017, at 10:07 AM, Brady Eidson wrote: > > > >> On Sep 1, 2017, at 9:46 AM, Maciej Stachowiak wrote: >>> >>> Does RefPtr do anything for us today that std::optional doesn’t? >> >> The obvious things would be: uses less storage space > > Grumble. If that’s true (which, thinking

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

2017-09-01 Thread Filip Pizlo
> On Sep 1, 2017, at 10:07 AM, Brady Eidson wrote: > > > >> On Sep 1, 2017, at 9:46 AM, Maciej Stachowiak wrote: >>> >>> Does RefPtr do anything for us today that std::optional doesn’t? >> >> The obvious things would be: uses less storage space > > Grumble. If that’s true (which, thinking

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

2017-09-01 Thread Brady Eidson
> On Sep 1, 2017, at 9:46 AM, Maciej Stachowiak wrote: >> >> Does RefPtr do anything for us today that std::optional 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

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

2017-09-01 Thread Filip Pizlo
> On Sep 1, 2017, at 10:09 AM, Chris Dumez wrote: > > I think std::optional> looks ugly. Also, unlike RefPtr<>, I do not > think it is copyable. It is pretty neat to be able to capture a RefPtr<> by > value in a lambda. > Also, how do you convert it to a raw pointer? myOptionalRef.value_or(nu

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

2017-09-01 Thread Chris Dumez
I think std::optional> looks ugly. Also, unlike RefPtr<>, I do not think it is copyable. It is pretty neat to be able to capture a RefPtr<> by value in a lambda. Also, how do you convert it to a raw pointer? myOptionalRef.value_or(nullptr) would not work. Not sure there would be a nice way to do

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

2017-09-01 Thread Filip Pizlo
> On Sep 1, 2017, at 9:30 AM, Brady Eidson 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 instead > of a RefPtr. > > A followup review after it had already landed pointed this out, and i

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

2017-09-01 Thread Maciej Stachowiak
> On Sep 1, 2017, at 9:30 AM, Brady Eidson 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 instead > of a RefPtr. > > A followup review after it had already landed pointed this out, and i

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

2017-09-01 Thread Brady Eidson
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 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