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

2018-12-16 Thread Maciej Stachowiak
> On Dec 16, 2018, at 8:37 PM, Chris Dumez wrote: > > >> On Dec 16, 2018, at 7:43 PM, Fujii Hironori wrote: >> >> I don't like the proposal because it encourages misuse of move. >> We can use move only for values about to be destroyed. > > Just for reference, there are close to 400 matches

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

2018-12-16 Thread Maciej Stachowiak
> On Dec 16, 2018, at 3:47 PM, Daniel Bates wrote: > > > >> On Dec 14, 2018, at 3:52 PM, Chris Dumez > > wrote: >> >> 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 o

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

2018-12-16 Thread Fujii Hironori
I've changed my mind. It is ensured std::vector move constructor makes moved value empty. > After the move, other is guaranteed to be empty(). https://en.cppreference.com/w/cpp/container/vector/vector Unfortunately, WTF::Vector move constructor just swaps values. I think this swapping is not a

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

2018-12-16 Thread Chris Dumez
> On Dec 16, 2018, at 7:43 PM, Fujii Hironori wrote: > > I don't like the proposal because it encourages misuse of move. > We can use move only for values about to be destroyed. Just for reference, there are close to 400 matches for "WTFMove(m_” in our code base. People do seem to rely on the

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

2018-12-16 Thread Fujii Hironori
I don't like the proposal because it encourages misuse of move. We can use move only for values about to be destroyed. I like Dan's suggestion. We should use std::exchange or std::optional::swap for the cases. Or, what about adding a new method WTF::Optional::release() for the case? __

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

2018-12-16 Thread Daniel Bates
> On Dec 14, 2018, at 3:52 PM, Chris Dumez > wrote: > > 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_dataMe

Re: [webkit-dev] Don Olmstead and Ross Kirsling are now WebKit reviewers

2018-12-16 Thread Adrian Perez de Castro
Hello all, On Fri, 14 Dec 2018 06:46:20 +0900, Fujii Hironori wrote: > I would like to announce that Don Olmstead (dolmstead on #webkit) and > Ross Kirsling (rkirsling) are now WebKit reviewers. They have worked > on WinCairo port and PlayStation port, and Ross worked on Web > Inspector Layers