Good day everyone,
I have been trying the following code to reset all pointers in a list to nullptr as shown below:
for (auto item : { ptr1, ptr2, ptr3 })
item = nullptr;
the problem is that a copy of the pointer is made to item, so the original ptrs are unequal to nullptr at the end.
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!