[webkit-dev] Watch out for std::optional's move constructor
ggaren at apple.com
Sat Dec 15 11:24:07 PST 2018
> This expression WTFMove(*m_pendingWebsitePolicies) doesn't move std::optional<WebsitePoliciesData>, but moves the content of the std::optional, WebsitePoliciesData. I think your proposal doesn't work for this code.
The original code, which asserted, did this:
if (auto pendingWebsitePolicies = WTFMove(m_pendingWebsitePolicies))
The relevant expression was "WTFMove(m_pendingWebsitePolicies)”, which did move std::optional<WebsitePoliciesData>. The expectation in the code was that, after WTFMove(m_pendingWebsitePolicies), m_pendingWebsitePolicies would be empty.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev