title: using a range-based for-loop to iterate through a list of pointers
body: <p>Good day everyone,</p>
  <p>I have been trying the following code to reset all pointers in a list to nullptr as shown below:</p>
  <pre><code>    for (auto item : { ptr1, ptr2, ptr3 })
          item = nullptr;
  </code></pre>
  <p>the problem is that a copy of the pointer is made to item, so the original ptrs are unequal to nullptr at the end.</p>
  <p>I would like to get some sort of reference to the pointers themselves or maybe there is already a better alternative to setting all pointers in a container to nullptr. If any of you happen to work with Qt maybe there's a good way of doing it in Qt? Thanks in advance!</p>