[webkit-dev] Watch out for std::optional's move constructor

Fujii Hironori fujii.hironori at gmail.com
Tue Dec 18 05:38:10 PST 2018


On Tue, Dec 18, 2018 at 10:21 PM Fujii Hironori <fujii.hironori at gmail.com>
wrote:

>
> On Tue, Dec 18, 2018 at 12:25 PM Ryosuke Niwa <ryosuke.niwa at gmail.com>
> wrote:
>
>> Also, as Geoff has already pointed out, the behavior of STL doesn't
>> prevent us from writing our own template library to always have a very well
>> specified & good state after std::move'ed & its value was move-constructed.
>>
>
> Do you mean only WTF classes should guarantee the valid empty state after
> moved-out?
> Should we use std::exchange and std::move properly for other classes in
> WebKit?
>
>

I guess the answer is all classes in WebKit which are moved by WTFMove.
I'm wondering how much runtime cost it will take to restore valid empty
state of all moved-out values.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20181218/d083247f/attachment.html>


More information about the webkit-dev mailing list