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

2018-12-18 Thread Antti Koivisto
On Tue, Dec 18, 2018 at 3:18 AM Geoffrey Garen wrote: > Again, the C++ standard does not say that moving from an object leaves the > object in an undefined state. > > The C++ standard does say: > > Objects of types defined in the C++ standard library may be moved from > (12.8). Move operations ma

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

2018-12-18 Thread Fujii Hironori
On Tue, Dec 18, 2018 at 12:25 PM Ryosuke Niwa 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 onl

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

2018-12-18 Thread Fujii Hironori
On Tue, Dec 18, 2018 at 10:21 PM Fujii Hironori wrote: > > On Tue, Dec 18, 2018 at 12:25 PM Ryosuke Niwa > 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 afte

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

2018-12-18 Thread Michael Catanzaro
I know I'm getting a bit far afield here, but: On Mon, Dec 17, 2018 at 9:26 PM, Ryosuke Niwa wrote: But then our behavior of HashMap which doesn't accept the POD integral value of 0 as a key This behavior is really unexpected and dangerous [1], and we should seriously consider changing it. N

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

2018-12-18 Thread Ryosuke Niwa
On Tue, Dec 18, 2018 at 11:35 AM Michael Catanzaro wrote: > I know I'm getting a bit far afield here, but: > > On Mon, Dec 17, 2018 at 9:26 PM, Ryosuke Niwa wrote: > > But then our behavior of HashMap which doesn't accept the POD > > integral value of 0 as a key > > This behavior is really unexp

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

2018-12-18 Thread Konstantin Tokarev
18.12.2018, 22:35, "Michael Catanzaro" : > I know I'm getting a bit far afield here, but: > > On Mon, Dec 17, 2018 at 9:26 PM, Ryosuke Niwa wrote: >>  But then our behavior of HashMap which doesn't accept the POD >>  integral value of 0 as a key > > This behavior is really unexpected and dangero

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

2018-12-18 Thread Fujii Hironori
On Wed, Dec 19, 2018 at 6:41 AM Konstantin Tokarev wrote: > > I agree that "atomic" part of AtomicString is kinda misleading, however > wiki > explains it all > > https://trac.webkit.org/wiki/EfficientStrings#AtomicStringVSString > > BTW, /me personally didn't know what "interned string" is until

Re: [webkit-dev] the name "AtomicString"

2018-12-18 Thread Darin Adler
The name “AtomicString” was inspired by the term of art, “atom”, traditionally used in at least some programming language implementations for what I see now is often called interned strings. You’ll see a mention of that term in the article https://en.wikipedia.org/wiki/String_interning in the co