You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
The problem is that both implementations have different performance characteristics, and more importantly different iterator/reference invalidation semantics.
For example AFAICT code like this:
m["a"] = m["b"];
is safe when inserting "a" into m causes a resizing with the node-based implementation, but not with the flat one, resulting in UB.
And more generally, code which works fine with the node-based one might break subtly with the flat one.
It can be quite confusing since subtle changes to the key or value types - which can occur for example when compiling with a different compiler/libraries - can cause a change in the underlying implementation used.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi!
First, thanks for the amazing work!
I understand the motivation, but I think that having
unordered_map
try to automatically pick between the node and flat implementations is error prone:robin-hood-hashing/src/include/robin_hood.h
Line 2519 in 9145f96
The problem is that both implementations have different performance characteristics, and more importantly different iterator/reference invalidation semantics.
For example AFAICT code like this:
is safe when inserting
"a"
intom
causes a resizing with the node-based implementation, but not with the flat one, resulting in UB.And more generally, code which works fine with the node-based one might break subtly with the flat one.
It can be quite confusing since subtle changes to the key or value types - which can occur for example when compiling with a different compiler/libraries - can cause a change in the underlying implementation used.
The text was updated successfully, but these errors were encountered: