[webkit-dev] Watch out for std::optional's move constructor
cdumez at apple.com
Fri Dec 14 15:52:32 PST 2018
So to be clear, it is often not truly about using the value after it is moved. It is about expecting that the variable / member has been nulled out after moving it.
If I WTFMove() out a data member m_dataMember, I expect later on `if (m_dataMember)` to be false.
> On Dec 14, 2018, at 3:45 PM, Chris Dumez <cdumez at apple.com> wrote:
>> On Dec 14, 2018, at 3:39 PM, Fujii Hironori <fujii.hironori at gmail.com <mailto:fujii.hironori at gmail.com>> wrote:
>> On Sat, Dec 15, 2018 at 6:38 AM Chris Dumez <cdumez at apple.com <mailto:cdumez at apple.com>> wrote:
>> I have now been caught twice by std::optional’s move constructor.
>> I don't understand how this could be useful? Do you want to use the value after it is moved? I'd like to see these your code. Could you show me these two patches?
> This is the latest one: https://trac.webkit.org/changeset/239228/webkit <https://trac.webkit.org/changeset/239228/webkit>
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev