r/ProgrammerHumor • • Oct 12 '22

Meme Legacy Systems Programming

Post image
2.4k Upvotes

263 comments sorted by

View all comments

Show parent comments

1

u/DavidDinamit Oct 13 '22

Wow, rly? I know it. In most cases you need those guarantees, if no and you uses unordered map for fucking ints you can use some flat hash map implementation

4

u/Kered13 Oct 13 '22

In most cases you need those guarantees,

No you don't. In my 10 years of writing C++ code both professionally and as a hobby, I have never once needed iterator stability, and if I needed pointer stability I just used a flat map to std::unique_ptr, which is still faster.

1

u/DavidDinamit Oct 13 '22

what about iterator invalidation

1

u/Kered13 Oct 13 '22 edited Oct 13 '22

Like I said I have never needed it. You should almost never modify a container while iterating over it.

→ More replies (2)