<div dir="ltr">Hello everyone!<div><br></div><div>I'm a newcomer for the great <span class="" id=":2hd.75" tabindex="-1" style="background:yellow">LLVM</span> project. I've started to explore the source code of <span class="" id=":2hd.76" tabindex="-1" style="background:yellow">LLVM</span> project to become more familiar with it, and I've found some strange usage of move semantics in <span class="" id=":2hd.77" tabindex="-1">constructor</span> of <span class="" id=":2hd.78" tabindex="-1" style="background:yellow">StringMapImpl</span>(<span class="" id=":2hd.79" tabindex="-1" style="background:yellow">StringMapImpl</span> &&<span class="" id=":2hd.80" tabindex="-1" style="background:yellow">RHS</span>) {...} class in include/<span class="" id=":2hd.81" tabindex="-1" style="background:yellow">llvm</span>/<span class="" id=":2hd.82" tabindex="-1" style="background:yellow">ADT</span>/<span class="" id=":2hd.83" tabindex="-1" style="background:yellow">StringMap</span>.h line 56. Could anyone explain me the <span class="" id=":2hd.84" tabindex="-1" style="background:yellow">purpose</span> of zeroing of all fields of <span class="" id=":2hd.85" tabindex="-1" style="background:yellow">RHS</span> in the body of this <span class="" id=":2hd.86" tabindex="-1">constructor</span> if the declaration of the <span class="" id=":2hd.87" tabindex="-1">constructor</span> uses move semantics? Here is the consturctor code below:</div><div><div><br></div><div><i>StringMapImpl(StringMapImpl &&RHS)</i></div><div><i>      : TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets),</i></div><div><i>        NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones),</i></div><div><i>        ItemSize(RHS.ItemSize) {</i></div><div><i>    RHS.TheTable = nullptr;</i></div><div><i>    RHS.NumBuckets = 0;</i></div><div><i>    RHS.NumItems = 0;</i></div><div><i>    RHS.NumTombstones = 0;</i></div><div><i>  }</i></div><div><br></div></div><div>Thank you very <span class="" id=":2hd.88" tabindex="-1" style="background:yellow">much</span>!</div><div><br></div><div>BR,</div><div>Valeriy</div></div>