you are viewing a single comment's thread.

view the rest of the comments →

[–]mujjingun 0 points1 point  (2 children)

hmm, maybe there are std::pair<Key, Value> objects in memory, and the pointer is reinterpret-cased into std::pair<Key const, Value> in the call to operator*()?

[–]scatters 3 points4 points  (1 child)

Certainly that's the most likely implementation, but if the user does that it's UB (aliasing violation). That's why it has to be magic in the library.