Hacker News new | ask | show | jobs
by wakawaka28 798 days ago
This is a noob mistake, not a huge mystery. It's not always wrong to store raw pointers to STL container elements, but if you do then you must take care of reallocations.

If you find storing pointers to elements too perilous, you should probably just make a container of pointers instead.

1 comments

> This is a noob mistake, not a huge mystery.

The interesting part is why it worked in VS2013 but failed in VS2022.

>The interesting part is why it worked in VS2013 but failed in VS2022.

I thought the explanation he came up with was interesting but such a change could have easily been brought about by changes to reallocation parameters in the implementation.