4 ms·
You’re right about std::unordered_map but std::vector storage is guaranteed to be continuous[1]. [1] https://en.cppreference.com/w/cpp/container/vector https:/
by ericbarrett 6y ago
You’re right about std::unordered_map but std::vector storage is guaranteed to be continuous[1].
[1] https://en.cppreference.com/w/cpp/container/vector https://en.cppreference.com/w/cpp/container/vector
- vladharbuz 6y agoYou're right! I realised my mistake and edited my post in the meantime.
- ncmncm 6y agounordered_map is usually fine if you keep the loading below 0.5. It is also fine if you don't care, as for example during program start-up. BTW, vector is contiguous, not continuous.